On Thu, Dec 1, 2022 at 3:23 PM Andrew Athan <andrew...@gmail.com> wrote: > > I am new to go devops (but not to the language). First, I must say, the go > module documentation is thorough but absolutely inscrutable for new users. > Googling for things like "golang add github module vendor" brings up what > appear to be either outdated or incorrect cookbooks. I've already wasted 1 > hour trying to figure out "the right way" to a module provided by a github > repo to an existing vendor'ed golang project. > > In short: HEEEELP! > > All I want to do is use `github.com/dustinxie/lockfree.git` in the project, > which *does* commit the vendor directory to its git repo. I cannot seem to > find any semver defined in the lockfree project so I have no idea what to > specify by hand to go.mod, and there is a bewildering set possible commands > to use ... from `go get` to `go install` to `govendor` to `godep` (the latter > appear to be old news?) > > I would be eternally grateful for a few simple examples added to the golang > reference and/or tutorials for how to do this.
First make sure that you have a go.mod file, typically by running "go mod init my-package-path". Then run "go get github.com/dustinxie/lockfree". The "go get" command will add the package to your go.mod file, and you will be able to import it in your Go files. A reasonable starting point is https://go.dev/blog/using-go-modules . If you want to do something else, please explain further what you are looking for. Thanks. Ian -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/CAOyqgcXoThVn0j1MsT%2B_sFXVhqJp0VWna%2BgYMjXJ2M0NjjM_rw%40mail.gmail.com.