Problem while using go module

pavan@localhost:~/Pavan/gowork/src$ go run streamer.go
streamer.go:5:5: package oci-go-sdk/v42/common is not in GOROOT (/usr/local/go/src/oci-go-sdk/v42/common)
pavan@localhost:~/Pavan/gowork/src$ echo $GOROOT
pavan@localhost:~/Pavan/gowork/src$ cat …/go.mod
module ociwork_com/gowork

go 1.16

require v42.0.0 // indirect
pavan@localhost:~/Pavan/gowork/src$ echo $GOPATH

I am unable to use the go module. The sdk is downloaded using the command
‘’’ go get ‘’’

and i see that it is downloaded inside the GOPATH.
How do i get it working?

Try running “go mod tidy” in your project containing the go.mod. Works wonders sometimes.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.