How can I specify ports using Go remote import paths?

后端 未结 2 399
我在风中等你
我在风中等你 2020-12-19 03:40

given I have a private (corporate self-hosted) git repository which listens on on another but the default http-port. (For example 6655)

The full repository-url to my

2条回答
  •  佛祖请我去吃肉
    2020-12-19 04:17

    Like a previous comment said you probably want to clone the Git repository into your $GOPATH (%GOPATH% for Windows) directory.

    Per your example the clone command would look like:

    git clone internal-git.corporate-domain.com:6655/~myuser/golang-lib.git $GOPATH/corporate-domain.com/golang-lib
    

    And your import in Go source files would look like:

    import "corporate-domain.com/golang-lib"
    

提交回复
热议问题