How can I specify ports using Go remote import paths?

后端 未结 2 394
我在风中等你
我在风中等你 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:16

    Another solution is to change your .gitconfig to work with ports.

    [url "git@internal-git.corporate-domain.com:6655"]
      insteadOf = git://internal-git.corporate-domain.com
    
    0 讨论(0)
  • 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"
    
    0 讨论(0)
提交回复
热议问题