'How to use "go get" to retrieve modules / packages from a private server

I would like to install/get packages from AWS instance git([email protected]/folder1/folder2/sample.git) to local using "go get" command. Then, this will update in the go.mod file automatically. Example command I want to run is: go get [email protected]/folder1/folder2/sample.git

Example go.mod file:

module example.net/folder1/folder2/

go 1.17

require (
    example.net/folder1/folder2/ v1.5.0 // indirect
    example.net/folder1/folder2/ v1.5.0 // indirect
    example.net/folder1/folder2/ v0.0.0-20200822124328-c89045814202 // indirect
)

But, when I run the command, I get the error "malformed module path "dev": missing dot in first path element".

Coud you please teach me how should I resolve this error? Thank you very much in advance.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source