Helena (hexylena) opened
Hi y'all, I'm really excited to try using git-bug as a backend for a personal project, but I'm getting a bit stuck on how the operations should work.
I've tried both v0.8.0 and master but both fail to unmarshal the identity in the operation. (I've copied the example_test.go to my own project, set the package to main, and renamed the test function to main as well. go get github.com/MichaelMure/git-bug/entity was run to fetch the deps)
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0xb3db9c]
goroutine 1 [running]:
main.main()
/home/user/arbeit/emc/projects/testing/example.go:338 +0x89c
exit status 2
Adding some debugging in relevant places makes it clear
diff --git a/example.go b/example.go
index 3899be1..15c3c15 100644
--- a/example.go
+++ b/example.go
@@ -328,11 +328,20 @@ func main() {
confRene.Append(NewSetSignatureRequired(rene, true))
// Rene commits on its own repo
- _ = confRene.Commit(repoRene)
+ err := confRene.Commit(repoRene)
+ if err != nil {
+ panic(err)
+ }
// Isaac pull and read the config
- _ = dag.Pull(def, wrapper, repoIsaac, simpleResolvers(repoIsaac), "origin", isaac)
- confIsaac, _ := Read(repoIsaac, confRene.Id())
+ err = dag.Pull(def, wrapper, repoIsaac, simpleResolvers(repoIsaac), "origin", isaac)
+ if err != nil {
+ panic(err)
+ }
+ confIsaac, err := Read(repoIsaac, confRene.Id())
+ if err != nil {
+ panic(err)
+ }
// Compile gives the current state of the config
with the error:
panic: merge failure: remote project config is not readable: json: cannot unmarshal object into Go struct field AddAdministrator.to_add of type identity.Interface
goroutine 1 [running]:
main.main()
/home/user/arbeit/emc/projects/testing/example.go:339 +0xc28
exit status 2
it seems like this is possibly due to https://github.com/MichaelMure/git-bug/blob/3297223022630bd3aac2d119ae0870c995a7da2e/entities/identity/identity.go#L85
Any suggestions or would it be possible that this example could be updated to function again?