Avatar ·

How to properly download a private repository via go get?

Hello everyone. I'm new to Go and trying to understand modules. Our company has several internal libraries that are stored in private repositories on GitHub (and GitLab). I added SSH keys to my account, and I can clone repositories via `git clone ssh://git@github.com/company/lib.git` successfully. But when I try to use `go get` to add a dependency to my project, it fails with an error. Here's what I'm doing: Creating a new module: ``` go mod init myproject ``` Trying to add a dependency: ``` go get github.com/company/private-lib@v1.0.0 ``` Getting an error: ``` go: github.com/company/private-lib@v1.0.0: reading https://github.com/company/private-lib?go-get=1: 404 Not Found ``` I tried different options: set `GOPRIV=github.com/company`, `GONOSUMCHECK=*`, but none