Kubernetes-Workshop icon indicating copy to clipboard operation
Kubernetes-Workshop copied to clipboard

cannot find package error

Open aniecki opened this issue 4 years ago • 1 comments

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)

aniecki avatar Feb 24 '21 19:02 aniecki

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

jerrycan321 avatar Apr 09 '21 13:04 jerrycan321