Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cannot find package error #2

Open
aniecki opened this issue Feb 24, 2021 · 1 comment
Open

cannot find package error #2

aniecki opened this issue Feb 24, 2021 · 1 comment

Comments

@aniecki
Copy link

aniecki commented Feb 24, 2021

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)

@jerrycan321
Copy link

jerrycan321 commented Apr 9, 2021

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants