Go mod vendor - indirect packages


I have a go project that using third party packages. These packages are located at github.
I do not have any problem building the project.

But, then I run:
go mod vendor

I will only copy packages from the go.mod file that are not // indirect - packages.
I want to “vendor” all my packages, so I can build it even if the repository will be deleted.

I know it is possible to setup a GOPROXY, to solve the “deleted repository”-problem. But a vendor directory with all the dependent source code works for me.

Any ideas ?

// Micke

Hi (again)

I found a solution, my bad.
Then building:
go build -mod=vendor .

This will use all packages in the vendor directory. No problem then buildning.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.