Skip to content

Instantly share code, notes, and snippets.

@blackwood821
Created March 21, 2022 20:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save blackwood821/b677216a7ab880366d32aaeda3d3784f to your computer and use it in GitHub Desktop.
Save blackwood821/b677216a7ab880366d32aaeda3d3784f to your computer and use it in GitHub Desktop.
docker-machine-driver-triton
Chads-MacBook-Pro:docker-machine-driver-triton chad$ go build
driver.go:12:2: cannot find package "github.com/docker/machine/libmachine/drivers" in any of:
        /usr/local/Cellar/go/1.18/libexec/src/github.com/docker/machine/libmachine/drivers (from $GOROOT)
        /Users/chad/go/src/github.com/docker/machine/libmachine/drivers (from $GOPATH)
main.go:4:2: cannot find package "github.com/docker/machine/libmachine/drivers/plugin" in any of:
        /usr/local/Cellar/go/1.18/libexec/src/github.com/docker/machine/libmachine/drivers/plugin (from $GOROOT)
        /Users/chad/go/src/github.com/docker/machine/libmachine/drivers/plugin (from $GOPATH)
driver.go:13:2: cannot find package "github.com/docker/machine/libmachine/engine" in any of:
        /usr/local/Cellar/go/1.18/libexec/src/github.com/docker/machine/libmachine/engine (from $GOROOT)
        /Users/chad/go/src/github.com/docker/machine/libmachine/engine (from $GOPATH)
driver.go:14:2: cannot find package "github.com/docker/machine/libmachine/log" in any of:
        /usr/local/Cellar/go/1.18/libexec/src/github.com/docker/machine/libmachine/log (from $GOROOT)
        /Users/chad/go/src/github.com/docker/machine/libmachine/log (from $GOPATH)
driver.go:15:2: cannot find package "github.com/docker/machine/libmachine/mcnflag" in any of:
        /usr/local/Cellar/go/1.18/libexec/src/github.com/docker/machine/libmachine/mcnflag (from $GOROOT)
        /Users/chad/go/src/github.com/docker/machine/libmachine/mcnflag (from $GOPATH)
driver.go:16:2: cannot find package "github.com/docker/machine/libmachine/state" in any of:
        /usr/local/Cellar/go/1.18/libexec/src/github.com/docker/machine/libmachine/state (from $GOROOT)
        /Users/chad/go/src/github.com/docker/machine/libmachine/state (from $GOPATH)
driver.go:18:2: cannot find package "github.com/joyent/triton-go" in any of:
        /usr/local/Cellar/go/1.18/libexec/src/github.com/joyent/triton-go (from $GOROOT)
        /Users/chad/go/src/github.com/joyent/triton-go (from $GOPATH)
driver.go:19:2: cannot find package "github.com/joyent/triton-go/authentication" in any of:
        /usr/local/Cellar/go/1.18/libexec/src/github.com/joyent/triton-go/authentication (from $GOROOT)
        /Users/chad/go/src/github.com/joyent/triton-go/authentication (from $GOPATH)
driver.go:20:2: cannot find package "github.com/joyent/triton-go/compute" in any of:
        /usr/local/Cellar/go/1.18/libexec/src/github.com/joyent/triton-go/compute (from $GOROOT)
        /Users/chad/go/src/github.com/joyent/triton-go/compute (from $GOPATH)
Chads-MacBook-Pro:docker-machine-driver-triton chad$ go mod init driver.go 
go: creating new go.mod: module driver.go
go: copying requirements from Gopkg.lock
go: to add module requirements and sums:
        go mod tidy
Chads-MacBook-Pro:docker-machine-driver-triton chad$ go mod tidy
go: finding module for package github.com/abdullin/seq
go: finding module for package gopkg.in/gemnasium/logrus-airbrake-hook.v2
go: finding module for package github.com/sean-/seed
go: finding module for package github.com/stretchr/testify/assert
go: finding module for package github.com/sirupsen/logrus
go: found github.com/stretchr/testify/assert in github.com/stretchr/testify v1.7.1
go: found github.com/abdullin/seq in github.com/abdullin/seq v0.0.0-20160510034733-d5467c17e7af
go: found github.com/sean-/seed in github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529
go: found github.com/sirupsen/logrus in github.com/sirupsen/logrus v1.8.1
go: found gopkg.in/gemnasium/logrus-airbrake-hook.v2 in gopkg.in/gemnasium/logrus-airbrake-hook.v2 v2.1.2
go: finding module for package gopkg.in/airbrake/gobrake.v2
go: found gopkg.in/airbrake/gobrake.v2 in gopkg.in/airbrake/gobrake.v2 v2.0.9

Then in the generated go.mod file VSCode gives me this warning:

Inconsistent vendoring detected. Please re-run "go mod vendor".
See https://github.com/golang/go/issues/39164 for more detail on this issue.
Chads-MacBook-Pro:docker-machine-driver-triton chad$ go mod vendor
Chads-MacBook-Pro:docker-machine-driver-triton chad$
Chads-MacBook-Pro:docker-machine-driver-triton chad$ go build
# golang.org/x/sys/unix
vendor/golang.org/x/sys/unix/syscall_darwin.1_13.go:25:3: //go:linkname must refer to declared function or variable
vendor/golang.org/x/sys/unix/zsyscall_darwin_amd64.1_13.go:27:3: //go:linkname must refer to declared function or variable
vendor/golang.org/x/sys/unix/zsyscall_darwin_amd64.1_13.go:40:3: //go:linkname must refer to declared function or variable
vendor/golang.org/x/sys/unix/zsyscall_darwin_amd64.go:28:3: //go:linkname must refer to declared function or variable
vendor/golang.org/x/sys/unix/zsyscall_darwin_amd64.go:43:3: //go:linkname must refer to declared function or variable
vendor/golang.org/x/sys/unix/zsyscall_darwin_amd64.go:59:3: //go:linkname must refer to declared function or variable
vendor/golang.org/x/sys/unix/zsyscall_darwin_amd64.go:75:3: //go:linkname must refer to declared function or variable
vendor/golang.org/x/sys/unix/zsyscall_darwin_amd64.go:90:3: //go:linkname must refer to declared function or variable
vendor/golang.org/x/sys/unix/zsyscall_darwin_amd64.go:105:3: //go:linkname must refer to declared function or variable
vendor/golang.org/x/sys/unix/zsyscall_darwin_amd64.go:121:3: //go:linkname must refer to declared function or variable
vendor/golang.org/x/sys/unix/zsyscall_darwin_amd64.go:121:3: too many errors
Chads-MacBook-Pro:docker-machine-driver-triton chad$ go get -u golang.org/x/sys
go: upgraded golang.org/x/sys v0.0.0-20191026070338-33540a1f6037 => v0.0.0-20220319134239-a9b59b0215f8
Chads-MacBook-Pro:docker-machine-driver-triton chad$ go build
go: inconsistent vendoring in /opt/projects/github.com/joyent/docker-machine-driver-triton:
        golang.org/x/sys@v0.0.0-20220319134239-a9b59b0215f8: is explicitly required in go.mod, but not marked as explicit in vendor/modules.txt
        golang.org/x/sys@v0.0.0-20191026070338-33540a1f6037: is marked as explicit in vendor/modules.txt, but not explicitly required in go.mod

        To ignore the vendor directory, use -mod=readonly or -mod=mod.
        To sync the vendor directory, run:
                go mod vendor
Chads-MacBook-Pro:docker-machine-driver-triton chad$ go mod vendor
Chads-MacBook-Pro:docker-machine-driver-triton chad$ go build
Chads-MacBook-Pro:docker-machine-driver-triton chad$ ls -l driver.go 
-rwxr-xr-x  1 chad  staff  10452976 Mar 21 15:53 driver.go
Chads-MacBook-Pro:docker-machine-driver-triton chad$ file driver.go 
driver.go: Mach-O 64-bit executable x86_64
Chads-MacBook-Pro:docker-machine-driver-triton chad$ git checkout driver.go 
Updated 1 path from the index
Chads-MacBook-Pro:docker-machine-driver-triton chad$ file driver.go 
driver.go: ASCII text
Chads-MacBook-Pro:docker-machine-driver-triton chad$ go build -o docker-machine-driver-triton
Chads-MacBook-Pro:docker-machine-driver-triton chad$ file docker-machine-driver-triton 
docker-machine-driver-triton: Mach-O 64-bit executable x86_64
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment