This is a creation in Article, where the information may have evolved or changed.
Use dep
instead go get
to get a private library
(Kyung's Column 2017.11)
go get
The function is weak, unable to get branches, tags, specific versions, fork, and dep
can do. dep
You can also get a private library.
Use the gitee.com Private library as a test. Create a gogettest library.
Available:
get -u gitee.com/jinq0123/gogettest
If you change to a private library, it fails:
gethttps://gitee.com/jinq0123/gogettest?go-get=1fromhttps://gitee.com/jinq0123/gogettest?go-get=1403"gitee.com/jinq0123/gogettest"https://gitee.com/jinq0123/gogettest?go-get=1: no go-import meta tags ())
Use the DEP tool to take a private library
Https://github.com/golang/dep
Installing DEP
get -u github.com/golang/dep/cmd/dep
Initialization
Run in project directory:
dep init
Generate Gopkg.toml
andGopkg.lock
Add Force (Constraint)
Add in GOPKG.TOML:
[[constraint]] "master" "gitee.com/jinq012345/gogettest" "https://gitee.com/jinq0123/gogettest.git"
Source enforces the use of HTTPS to obtain the Gotgettest library.
Notice that the library name is changed so that the jinq012345
import:
imort "gitee.com/jinq012345/gogettest"
The settings for name and source support are obtained from the Fork Library.
Get gogettest
Library
ensure
An HTTPS login username and password entry box will pop up.