I believe the structure is correct, but there are a lot of details to fill in - translating the C string parsing logic into Go is not always straightforward.
Use a regexp for simplicity, unlike the direct parsing in Git.