You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
To fix cannot find package "go.opentelemetry.io/otel/api/trace" or undefined: otel.Meter:
Make sure to initialize a Go module: go mod init github.com/my/repo
Make sure to use correct import path with v8 in the end: go get github.com/go-redis/redis/v8
For example:
mkdir /tmp/redis-test
cd /tmp/redis-test
go mod init redis-test
go get github.com/go-redis/redis/v8
The root cause
The error is not caused by OpenTelemetry. OpenTelemetry is just the first module Go tries to install. And the error will not go away until you start using Go modules properly.
The presence of $GOROOT or $GOPATH in error messages indicates that you are NOT using Go modules.