• go get: Add a module from a private GitHub repository

    2 min read

    GitHub private repository go get

    If you try to add a golang module that is on a private repository you'll get an error similar to this:

    $ go get github.com/pet2cattle/golang-demo
    go: downloading github.com/pet2cattle/golang-demo v0.0.0-20220925191817-0b4b7026fa7f
    go: github.com/pet2cattle/golang-demo@v0.0.0-20220925191817-0b4b7026fa7f: verifying module: github.com/pet2cattle/golang-demo@v0.0.0-20220925191817-0b4b7026fa7f: reading https://sum.golang.org/lookup/github.com/pet2cattle/golang-demo@v0.0.0-20220925191817-0b4b7026fa7f: 404 Not Found
            server response:
            not found: github.com/pet2cattle/golang-demo@v0.0.0-20220925191817-0b4b7026fa7f: invalid version: git ls-remote -q origin in /tmp/gopath/pkg/mod/cache/vcs/75d68059a7355b978972dea177e930262ce90abe410680b8db8a45a587e02c26: exit status 128:
                    fatal: could not read Username for 'https://github.com': terminal prompts disabled
            Confirm the import path was entered correctly.
            If this is a private repository, see https://golang.org/doc/faq#git_https for additional information.



From pet to cattle
Treat your kubernetes clusters like cattle, not pets