Kubernetes-Workshop
Kubernetes-Workshop copied to clipboard
cannot find package error
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o main
main.go:8:9: cannot find package "github.com/go-redis/redis/v7" in any of: /usr/local/go/src/github.com/go-redis/redis/v7 (from $GOROOT) /home/adam/go/kind/src/github.com/go-redis/redis/v7 (from $GOPATH)
This seems to resolve the issue for me: go mod init github.com/my/repo
Now the build seems to work: CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o httpd-counter $ file httpd-counter httpd-counter: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), statically linked, not stripped