C
C
cursor_pointer2020-10-13 18:07:37
go
cursor_pointer, 2020-10-13 18:07:37

Is it possible to import packages in golang only from github?

1) is go get tied to github?
2) Is it possible, when importing, not to specify a link to the github project, but to put this module into the system and import it by name, because tomorrow this repository may not exist.?

Newbie questions =) Trying Golang

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander Pavlyuk, 2020-10-13
@cursor_pointer

1) Not tied. go get successfully pulls packages from both gitlab and bitbucket, and even from your local git repo, if configured.
2) You can, but it's better then to put this package in the vendor folder inside your project. From there it will be automatically imported.
In general, it's better to use go modules: https://github.com/golang/go/wiki/Modules#quick-start

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question