I want to push to gitlab from a go program. I'm using go-git v5 for it. The standard push is working fine:
err := repo.Push(&git.PushOptions{
RefSpecs: []config.RefSpec{"refs/tags/*:refs/tags/*"},
Progress: os.Stdout,
})
Now I want to add a custom gitlab push option "ci.skip".
The git command would be git push -o ci.skip
. I tried adding Options like this:
err := repo.Push(&git.PushOptions{
RefSpecs: []config.RefSpec{"refs/tags/*:refs/tags/*"},
Progress: os.Stdout,
Options: map[string]string{"ci.skip":"true"},
})
but the compiler tells me
p.Options undefined (type *git.PushOptions has no field or method Options)
I don't really get it as the PushOptions struct clearly has this property. I'm pretty new to Go, so I probably miss some concept here.