Jetbrains Space + go get

Given:

Constraints:

First, let’s configure git. Add the following directive to ~/.gitconfig:

[url "git@git.jetbrains.space/<org-name>"]
    insteadOf = https://<org-name>.jetbrains.space/

Here <org-name> is the part of the domain name that belongs to your organization.

Create or reuse a project to host the library repositories. In the examples below I’ll assume it’s called lib — feel free to use any name you like.

Inside the lib project, create the repository for your library. Initialize the Go module like this:

go mod init <org-name>.jetbrains.space/lib/<lib-name>

Substitute the library/repository name for <lib-name>. Drop your library’s source code into the repository and push it.

To add your new internal library to a project, run the following:

export GONOSUMDB=<org-name>.jetbrains.space
go get <org-name>.jetbrains.space/lib/<lib-name>

With this in place, Go won’t go off to check your library against GOSUMDB, and it’ll be pulled in as a dependency.

What to do with the GONOSUMDB variable is up to you: