D
D
Dmitry Luzin2021-12-23 17:03:02
go
Dmitry Luzin, 2021-12-23 17:03:02

golang. How to put an external package on a computer without internet?

How to install an external package for golang on a computer without internet?
I'm building a project on a computer with Internet, transferring the contents from pkg/mod to a computer without Internet, but still can't see it (trying to download from the Internet). What else can be done?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
K
Kenit, 2021-12-23
@Kenit

It is necessary to look where global variables specify.
If the goal in general is to develop without the Internet, I would rather vendor dependencies.

D
Dmitry Sviridov, 2021-12-23
@dimuska139

Alternatively, point replace in go.mod to a local folder. You can also make a custom GOPROXY and install packages through it. And store the packages themselves on a computer without the Internet (see Athens ).

A
Alexander Pavlyuk, 2021-12-24
@pav5000

On a computer with internet, go mod vendor, this will download all the dependencies and put them in the vendor folder at the root of the project. After that, you can transfer it to a computer without an Internet and collect it there, the dependencies will be taken from the vendor folder.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question