go mod vendor
command constructs a directory named vendor
in the main module’s root directory that contains copies of all packages needed to support builds and tests of packages in the main modulego
command will load packages from the vendor
directory instead of downloading modules from their sources into the module cache and using packages those downloaded copiesEnable vendoring
go run -mod=vendor package