diff --git a/go.mod b/go.mod index a647282..3f10c8f 100644 --- a/go.mod +++ b/go.mod @@ -6,11 +6,11 @@ require ( github.com/fzipp/gocyclo v0.0.0-20150627053110-6acd4345c835 github.com/gordonklaus/ineffassign v0.0.0-20180909121442-1003c8bd00dc github.com/inconshreveable/mousetrap v1.0.0 // indirect - github.com/karalabe/xgo v0.0.0-20181007145344-72da7d1d3970 github.com/mitchellh/go-homedir v1.0.0 github.com/prometheus/client_golang v0.9.2 github.com/spf13/cobra v0.0.3 github.com/spf13/viper v1.3.1 golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3 golang.org/x/tools v0.0.0-20181128225727-c5b00d9557fd // indirect + src.techknowlogick.com/xgo v0.0.0-20190415010919-1502273fab15 ) diff --git a/go.sum b/go.sum index 96a452a..a80560f 100644 --- a/go.sum +++ b/go.sum @@ -22,8 +22,6 @@ github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4= github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= github.com/inconshreveable/mousetrap v1.0.0 h1:Z8tu5sraLXCXIcARxBp/8cbvlwVa7Z1NHg9XEKhtSvM= github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= -github.com/karalabe/xgo v0.0.0-20181007145344-72da7d1d3970 h1:0+1ZURVRim6FxA/jhWhJklsgoWc69q1sxlIu2Ztnhy0= -github.com/karalabe/xgo v0.0.0-20181007145344-72da7d1d3970/go.mod h1:iYGcTYIPUvEWhFo6aKUuLchs+AV4ssYdyuBbQJZGcBk= github.com/magiconair/properties v1.8.0 h1:LLgXmsheXeRoUOBOjtwPQCWIYqM/LU1ayDtDePerRcY= github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= github.com/matttproud/golang_protobuf_extensions v1.0.1 h1:4hp9jkHxhMHkqkrB3Ix0jegS5sx/RkqARlsWZ6pIwiU= @@ -64,6 +62,7 @@ golang.org/x/crypto v0.0.0-20181203042331-505ab145d0a9/go.mod h1:6SG95UA2DQfeDnf golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3 h1:x/bBzNauLQAlE3fLku/xy92Y8QwKX5HZymrMz2IiKFc= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/net v0.0.0-20181201002055-351d144fa1fc/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/sync v0.0.0-20181108010431-42b317875d0f h1:Bl/8QSvNqXvPGPGXa2z5xUTmV7VDcZyvRZ+QQXkXTZQ= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20181205085412-a5c9d58dba9a h1:1n5lsVfiQW3yfsRGu98756EH1YthsFqr/5mxHduZW2A= golang.org/x/sys v0.0.0-20181205085412-a5c9d58dba9a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -75,3 +74,5 @@ gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+ gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/yaml.v2 v2.2.2 h1:ZCJp+EgiOT7lHqUV2J862kp8Qj64Jo6az82+3Td9dZw= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +src.techknowlogick.com/xgo v0.0.0-20190415010919-1502273fab15 h1:pHKgCq4abc5TAZRZGcSCxuJOTvRwzGfnbZdgTsFDgng= +src.techknowlogick.com/xgo v0.0.0-20190415010919-1502273fab15/go.mod h1:Ood88figJtEukTnU20P1IrXhyAkbOIGi4YzmeHVtGH0= diff --git a/tools.go b/tools.go index 881b225..a90d043 100644 --- a/tools.go +++ b/tools.go @@ -42,6 +42,6 @@ import ( _ "github.com/client9/misspell/cmd/misspell" _ "github.com/fzipp/gocyclo" _ "github.com/gordonklaus/ineffassign" - _ "github.com/karalabe/xgo" _ "golang.org/x/lint/golint" + _ "src.techknowlogick.com/xgo" ) diff --git a/vendor/modules.txt b/vendor/modules.txt index dbab2ee..48d9f11 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -24,8 +24,6 @@ github.com/hashicorp/hcl/json/scanner github.com/hashicorp/hcl/json/token # github.com/inconshreveable/mousetrap v1.0.0 github.com/inconshreveable/mousetrap -# github.com/karalabe/xgo v0.0.0-20181007145344-72da7d1d3970 -github.com/karalabe/xgo # github.com/magiconair/properties v1.8.0 github.com/magiconair/properties # github.com/matttproud/golang_protobuf_extensions v1.0.1 @@ -79,3 +77,5 @@ golang.org/x/tools/go/gcexportdata golang.org/x/tools/go/internal/gcimporter # gopkg.in/yaml.v2 v2.2.2 gopkg.in/yaml.v2 +# src.techknowlogick.com/xgo v0.0.0-20190415010919-1502273fab15 +src.techknowlogick.com/xgo diff --git a/vendor/src.techknowlogick.com/xgo/.drone.jsonnet b/vendor/src.techknowlogick.com/xgo/.drone.jsonnet new file mode 100644 index 0000000..7b04ffa --- /dev/null +++ b/vendor/src.techknowlogick.com/xgo/.drone.jsonnet @@ -0,0 +1,53 @@ +local BuildSwitchDryRun(version='go-latest', tags='latest', dry=false) = { + name: if dry then 'dry-run-' + version else 'build-' + version, + pull: 'always', + image: 'plugins/docker', + settings: { + dockerfile: 'docker/' + version + '/Dockerfile', + context: 'docker/' + version, + password: { + from_secret: 'docker_password' + }, + username: { + from_secret: 'docker_username' + }, + repo: 'techknowlogick/xgo', + tags: tags, + dry_run: dry + }, + [if !dry then 'when']: { + branch: ['master'], + event: {exclude: ['pull_request']} + }, + [if dry then 'when']: { + event: {include: ['pull_request']} + }, +}; + +local BuildWithDiffTags(version='go-latest', tags='latest') = BuildSwitchDryRun(version, tags, false); +local BuildWithDiffTagsDry(version='go-latest', tags='latest') = BuildSwitchDryRun(version, tags, true); +local BuildStep(version='go-latest') = BuildWithDiffTags(version, version); +local BuildStepDry(version='go-latest') = BuildSwitchDryRun(version, version, true); + +{ +kind: 'pipeline', +name: 'default', +steps: [ + BuildStepDry('base'), + BuildStepDry('go-1.12.4'), + BuildStepDry('go-1.11.9'), + + BuildStep('base'), + BuildStep('go-1.12.4'), + BuildStep('go-1.12.x'), + BuildWithDiffTags(), + BuildStep('go-1.11.9'), + BuildStep('go-1.11.x'), + BuildStep('go-1.12.3'), + BuildStep('go-1.12.2'), + BuildStep('go-1.12.1'), + BuildStep('go-1.12.0'), + BuildStep('go-1.11.8'), + BuildStep('go-1.11.7'), +] +} diff --git a/vendor/src.techknowlogick.com/xgo/.drone.yml b/vendor/src.techknowlogick.com/xgo/.drone.yml new file mode 100644 index 0000000..b7b9324 --- /dev/null +++ b/vendor/src.techknowlogick.com/xgo/.drone.yml @@ -0,0 +1,289 @@ +--- +kind: pipeline +name: default + +platform: + os: linux + arch: amd64 + +steps: +- name: dry-run-base + pull: always + image: plugins/docker + settings: + context: docker/base + dockerfile: docker/base/Dockerfile + dry_run: true + password: + from_secret: docker_password + repo: techknowlogick/xgo + tags: base + username: + from_secret: docker_username + when: + event: + - pull_request + +- name: dry-run-go-1.12.4 + pull: always + image: plugins/docker + settings: + context: docker/go-1.12.4 + dockerfile: docker/go-1.12.4/Dockerfile + dry_run: true + password: + from_secret: docker_password + repo: techknowlogick/xgo + tags: go-1.12.4 + username: + from_secret: docker_username + when: + event: + - pull_request + +- name: dry-run-go-1.11.9 + pull: always + image: plugins/docker + settings: + context: docker/go-1.11.9 + dockerfile: docker/go-1.11.9/Dockerfile + dry_run: true + password: + from_secret: docker_password + repo: techknowlogick/xgo + tags: go-1.11.9 + username: + from_secret: docker_username + when: + event: + - pull_request + +- name: build-base + pull: always + image: plugins/docker + settings: + context: docker/base + dockerfile: docker/base/Dockerfile + password: + from_secret: docker_password + repo: techknowlogick/xgo + tags: base + username: + from_secret: docker_username + when: + branch: + - master + event: + exclude: + - pull_request + +- name: build-go-1.12.4 + pull: always + image: plugins/docker + settings: + context: docker/go-1.12.4 + dockerfile: docker/go-1.12.4/Dockerfile + password: + from_secret: docker_password + repo: techknowlogick/xgo + tags: go-1.12.4 + username: + from_secret: docker_username + when: + branch: + - master + event: + exclude: + - pull_request + +- name: build-go-1.12.x + pull: always + image: plugins/docker + settings: + context: docker/go-1.12.x + dockerfile: docker/go-1.12.x/Dockerfile + password: + from_secret: docker_password + repo: techknowlogick/xgo + tags: go-1.12.x + username: + from_secret: docker_username + when: + branch: + - master + event: + exclude: + - pull_request + +- name: build-go-latest + pull: always + image: plugins/docker + settings: + context: docker/go-latest + dockerfile: docker/go-latest/Dockerfile + password: + from_secret: docker_password + repo: techknowlogick/xgo + tags: latest + username: + from_secret: docker_username + when: + branch: + - master + event: + exclude: + - pull_request + +- name: build-go-1.11.9 + pull: always + image: plugins/docker + settings: + context: docker/go-1.11.9 + dockerfile: docker/go-1.11.9/Dockerfile + password: + from_secret: docker_password + repo: techknowlogick/xgo + tags: go-1.11.9 + username: + from_secret: docker_username + when: + branch: + - master + event: + exclude: + - pull_request + +- name: build-go-1.11.x + pull: always + image: plugins/docker + settings: + context: docker/go-1.11.x + dockerfile: docker/go-1.11.x/Dockerfile + password: + from_secret: docker_password + repo: techknowlogick/xgo + tags: go-1.11.x + username: + from_secret: docker_username + when: + branch: + - master + event: + exclude: + - pull_request + +- name: build-go-1.12.3 + pull: always + image: plugins/docker + settings: + context: docker/go-1.12.3 + dockerfile: docker/go-1.12.3/Dockerfile + password: + from_secret: docker_password + repo: techknowlogick/xgo + tags: go-1.12.3 + username: + from_secret: docker_username + when: + branch: + - master + event: + exclude: + - pull_request + +- name: build-go-1.12.2 + pull: always + image: plugins/docker + settings: + context: docker/go-1.12.2 + dockerfile: docker/go-1.12.2/Dockerfile + password: + from_secret: docker_password + repo: techknowlogick/xgo + tags: go-1.12.2 + username: + from_secret: docker_username + when: + branch: + - master + event: + exclude: + - pull_request + +- name: build-go-1.12.1 + pull: always + image: plugins/docker + settings: + context: docker/go-1.12.1 + dockerfile: docker/go-1.12.1/Dockerfile + password: + from_secret: docker_password + repo: techknowlogick/xgo + tags: go-1.12.1 + username: + from_secret: docker_username + when: + branch: + - master + event: + exclude: + - pull_request + +- name: build-go-1.12.0 + pull: always + image: plugins/docker + settings: + context: docker/go-1.12.0 + dockerfile: docker/go-1.12.0/Dockerfile + password: + from_secret: docker_password + repo: techknowlogick/xgo + tags: go-1.12.0 + username: + from_secret: docker_username + when: + branch: + - master + event: + exclude: + - pull_request + +- name: build-go-1.11.8 + pull: always + image: plugins/docker + settings: + context: docker/go-1.11.8 + dockerfile: docker/go-1.11.8/Dockerfile + password: + from_secret: docker_password + repo: techknowlogick/xgo + tags: go-1.11.8 + username: + from_secret: docker_username + when: + branch: + - master + event: + exclude: + - pull_request + +- name: build-go-1.11.7 + pull: always + image: plugins/docker + settings: + context: docker/go-1.11.7 + dockerfile: docker/go-1.11.7/Dockerfile + password: + from_secret: docker_password + repo: techknowlogick/xgo + tags: go-1.11.7 + username: + from_secret: docker_username + when: + branch: + - master + event: + exclude: + - pull_request + +... diff --git a/vendor/github.com/karalabe/xgo/LICENSE b/vendor/src.techknowlogick.com/xgo/LICENSE similarity index 100% rename from vendor/github.com/karalabe/xgo/LICENSE rename to vendor/src.techknowlogick.com/xgo/LICENSE diff --git a/vendor/github.com/karalabe/xgo/README.md b/vendor/src.techknowlogick.com/xgo/README.md similarity index 91% rename from vendor/github.com/karalabe/xgo/README.md rename to vendor/src.techknowlogick.com/xgo/README.md index ed4269c..10d3fd1 100644 --- a/vendor/github.com/karalabe/xgo/README.md +++ b/vendor/src.techknowlogick.com/xgo/README.md @@ -38,12 +38,12 @@ a single command to compile a Go package to various platforms and architectures. Although you could build the container manually, it is available as an automatic trusted build from Docker's container registry (not insignificant in size): - docker pull karalabe/xgo-latest + docker pull techknowlogick/xgo:latest To prevent having to remember a potentially complex Docker command every time, a lightweight Go wrapper was written on top of it. - go get github.com/karalabe/xgo + go get src.techknowlogick.com/xgo ## Usage @@ -202,8 +202,6 @@ versions of the same operating system. This however can lead to issues if a used dependency is only supported by more recent systems. As such, `xgo` supports the selection of specific platform versions by appending them to the OS target string. - * `--targets=ios-8.1/*`: cross compile to iOS 8.1 - * `--targets=android-16/*`: cross compile to Android Jelly Bean * `--targets=darwin-10.9/*`: cross compile to Mac OS X Mavericks * `--targets=windows-6.0/*`: cross compile to Windows Vista @@ -211,24 +209,7 @@ The supported platforms are: * All Android APIs up to Android Lollipop 5.0 ([API level ids](https://source.android.com/source/build-numbers.html)) * All Windows APIs up to Windows 8.1 limited by `mingw-w64` ([API level ids](https://en.wikipedia.org/wiki/Windows_NT#Releases)) - * OSX APIs in the range of 10.6 - 10.11 - * All iOS APIs up to iOS 9.3 - -### Mobile libraries - -Apart from the usual runnable binaries, `xgo` also supports building library -archives for Android (`android/aar`) and iOS (`ios/framework`). Opposed to -`gomobile` however `xgo` does not derive library APIs from the Go code, so -proper CGO C external methods must be defined within the package. - -In the case of Android archives, all architectures will be bundled that are -supported by the requested Android platform version. For iOS frameworks `xgo` -will bundle armv7 and arm64 by default, and also the x86_64 simulator builds -if the iPhoneSimulator.sdk was injected by the user: - -* Create a new docker image based on xgo: `FROM karalabe/xgo-latest` -* Inject the simulator SDK: `ADD iPhoneSimulator9.3.sdk.tar.xz /iPhoneSimulator9.3.sdk.tar.xz` -* Bootstrap the simulator SDK: `$UPDATE_IOS /iPhoneSimulator9.3.sdk.tar.xz` + * OSX APIs in the range of 10.6 - 10.14 ### CGO dependencies diff --git a/vendor/github.com/karalabe/xgo/testsuite.go b/vendor/src.techknowlogick.com/xgo/testsuite.go similarity index 88% rename from vendor/github.com/karalabe/xgo/testsuite.go rename to vendor/src.techknowlogick.com/xgo/testsuite.go index b03b7fe..05ba41d 100644 --- a/vendor/github.com/karalabe/xgo/testsuite.go +++ b/vendor/src.techknowlogick.com/xgo/testsuite.go @@ -26,11 +26,10 @@ var layers = []struct { tag string dir string }{ - {"karalabe/xgo-base", "base"}, - {"karalabe/xgo-1.6.2", "go-1.6.2"}, - {"karalabe/xgo-1.6.x", "go-1.6.x"}, - {"karalabe/xgo-latest", "go-latest"}, - //{"karalabe/xgo-latest-ios", "go-latest-ios"}, // Non-public layer (XCode licensing) + {"techknowlogick/xgo:base", "base"}, + {"techknowlogick/xgo:1.12.4", "go-1.12.4"}, + {"techknowlogick/xgo:1.12.x", "go-1.12.x"}, + {"techknowlogick/xgo:latest", "go-latest"}, } // tests defaines all the input test cases and associated arguments the cross @@ -44,12 +43,11 @@ var tests = []struct { {"github.com/karalabe/xgo/tests/embedded_cpp", nil}, // Baseline projects to ensure minimal requirements - //{"github.com/project-iris/iris", nil}, // Deps failed, disable {"github.com/ethereum/go-ethereum/cmd/geth", []string{"--branch", "develop"}}, // Third party projects using xgo, smoke test that they don't break {"github.com/rwcarlsen/cyan/cmd/cyan", nil}, - {"github.com/cockroachdb/cockroach", []string{"--targets", "darwin-10.11/amd64"}}, + {"github.com/cockroachdb/cockroach", []string{"--targets", "darwin-10.6/amd64"}}, } func main() { diff --git a/vendor/github.com/karalabe/xgo/xgo.go b/vendor/src.techknowlogick.com/xgo/xgo.go similarity index 80% rename from vendor/github.com/karalabe/xgo/xgo.go rename to vendor/src.techknowlogick.com/xgo/xgo.go index b2bae9c..efd168b 100644 --- a/vendor/github.com/karalabe/xgo/xgo.go +++ b/vendor/src.techknowlogick.com/xgo/xgo.go @@ -4,7 +4,7 @@ // Released under the MIT license. // Wrapper around the GCO cross compiler docker container. -package main +package main // import "src.techknowlogick.com/xgo" import ( "bytes" @@ -39,8 +39,8 @@ func init() { } // Cross compilation docker containers -var dockerBase = "karalabe/xgo-base" -var dockerDist = "karalabe/xgo-" +var dockerBase = "techknowlogick/xgo:base" +var dockerDist = "techknowlogick/xgo:" // Command line arguments to fine tune the compilation var ( @@ -233,49 +233,58 @@ func pullDockerImage(image string) error { func compile(image string, config *ConfigFlags, flags *BuildFlags, folder string) error { // If a local build was requested, find the import path and mount all GOPATH sources locals, mounts, paths := []string{}, []string{}, []string{} + var usesModules bool if strings.HasPrefix(config.Repository, string(filepath.Separator)) || strings.HasPrefix(config.Repository, ".") { // Resolve the repository import path from the file path config.Repository = resolveImportPath(config.Repository) + // Determine if this is a module-based repository + var modFile = config.Repository + "/go.mod" + _, err := os.Stat(modFile) + usesModules = !os.IsNotExist(err) + // Iterate over all the local libs and export the mount points - if os.Getenv("GOPATH") == "" { + if os.Getenv("GOPATH") == "" && !usesModules { log.Fatalf("No $GOPATH is set or forwarded to xgo") } - for _, gopath := range strings.Split(os.Getenv("GOPATH"), string(os.PathListSeparator)) { - // Since docker sandboxes volumes, resolve any symlinks manually - sources := filepath.Join(gopath, "src") - filepath.Walk(sources, func(path string, info os.FileInfo, err error) error { - // Skip any folders that errored out - if err != nil { - log.Printf("Failed to access GOPATH element %s: %v", path, err) + if !usesModules { + for _, gopath := range strings.Split(os.Getenv("GOPATH"), string(os.PathListSeparator)) { + // Since docker sandboxes volumes, resolve any symlinks manually + sources := filepath.Join(gopath, "src") + filepath.Walk(sources, func(path string, info os.FileInfo, err error) error { + // Skip any folders that errored out + if err != nil { + log.Printf("Failed to access GOPATH element %s: %v", path, err) + return nil + } + // Skip anything that's not a symlink + if info.Mode()&os.ModeSymlink == 0 { + return nil + } + // Resolve the symlink and skip if it's not a folder + target, err := filepath.EvalSymlinks(path) + if err != nil { + return nil + } + if info, err = os.Stat(target); err != nil || !info.IsDir() { + return nil + } + // Skip if the symlink points within GOPATH + if filepath.HasPrefix(target, sources) { + return nil + } + + // Folder needs explicit mounting due to docker symlink security + locals = append(locals, target) + mounts = append(mounts, filepath.Join("/ext-go", strconv.Itoa(len(locals)), "src", strings.TrimPrefix(path, sources))) + paths = append(paths, filepath.Join("/ext-go", strconv.Itoa(len(locals)))) return nil - } - // Skip anything that's not a symlink - if info.Mode()&os.ModeSymlink == 0 { - return nil - } - // Resolve the symlink and skip if it's not a folder - target, err := filepath.EvalSymlinks(path) - if err != nil { - return nil - } - if info, err = os.Stat(target); err != nil || !info.IsDir() { - return nil - } - // Skip if the symlink points within GOPATH - if filepath.HasPrefix(target, sources) { - return nil - } - // Folder needs explicit mounting due to docker symlink security - locals = append(locals, target) - mounts = append(mounts, filepath.Join("/ext-go", strconv.Itoa(len(locals)), "src", strings.TrimPrefix(path, sources))) + }) + // Export the main mount point for this GOPATH entry + locals = append(locals, sources) + mounts = append(mounts, filepath.Join("/ext-go", strconv.Itoa(len(locals)), "src")) paths = append(paths, filepath.Join("/ext-go", strconv.Itoa(len(locals)))) - return nil - }) - // Export the main mount point for this GOPATH entry - locals = append(locals, sources) - mounts = append(mounts, filepath.Join("/ext-go", strconv.Itoa(len(locals)), "src")) - paths = append(paths, filepath.Join("/ext-go", strconv.Itoa(len(locals)))) + } } } // Assemble and run the cross compilation command @@ -299,10 +308,32 @@ func compile(image string, config *ConfigFlags, flags *BuildFlags, folder string "-e", fmt.Sprintf("FLAG_BUILDMODE=%s", flags.Mode), "-e", "TARGETS=" + strings.Replace(strings.Join(config.Targets, " "), "*", ".", -1), } - for i := 0; i < len(locals); i++ { - args = append(args, []string{"-v", fmt.Sprintf("%s:%s:ro", locals[i], mounts[i])}...) + if usesModules { + args = append(args, []string{"-e", "GO111MODULE=on"}...) + args = append(args, []string{"-v", os.Getenv("GOPATH") + ":/go"}...) + + // Map this repository to the /source folder + absRepository, err := filepath.Abs(config.Repository) + if err != nil { + log.Fatalf("Failed to locate requested module repository: %v.", err) + } + args = append(args, []string{"-v", absRepository + ":/source"}...) + + fmt.Printf("Enabled Go module support\n") + + // Check whether it has a vendor folder, and if so, use it + vendorPath := absRepository + "/vendor" + vendorfolder, err := os.Stat(vendorPath) + if !os.IsNotExist(err) && vendorfolder.Mode().IsDir() { + args = append(args, []string{"-e", "FLAG_MOD=vendor"}...) + fmt.Printf("Using vendored Go module dependencies\n") + } + } else { + for i := 0; i < len(locals); i++ { + args = append(args, []string{"-v", fmt.Sprintf("%s:%s:ro", locals[i], mounts[i])}...) + } + args = append(args, []string{"-e", "EXT_GOPATH=" + strings.Join(paths, ":")}...) } - args = append(args, []string{"-e", "EXT_GOPATH=" + strings.Join(paths, ":")}...) args = append(args, []string{image, config.Repository}...) return run(exec.Command("docker", args...))