I need to debug a project with a few prints to stdout: https://github.com/protolambda/zcli
and it has a dependency on this: https://github.com/protolambda/zrnt
The piece of code I need to debug is inside of zrnt
.
I've installed the zcli
tool locally with go get -u -tags preset_minimal github.com/protolambda/zcli
and I can see the code for zrnt
in both ~/go/pkg/mod/github.com
and ~/go/src/github.com
- so my question is: Where should I edit and what command should I use to rebuild it?
And is there any easy way of removing all local changes from a package's source when I'm done - something like git checkout .
?
I'm totally new to Go and it would be desirable if I could avoid learning about the package management for a few hours...
One way to do this, use Go modules.
$ export GO111MODULE=on
$ go mod init github.com/protolambda/zcli
go: creating new go.mod: module github.com/protolambda/zcli
$cd github.com/protolambda/zcli
) and run:$ go mod tidy
$ go mod vendor
vendor
folder with all the dependencies. Edit them the way you like & use the following command to build your project.$ go build ./...
$ go mod vendor
to reset the main module's vendor directory.Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments