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
/usr/local/go
pavan@localhost:~/Pavan/gowork/src$ cat …/go.mod
module ociwork_com/gowork

go 1.16

require github.com/oracle/oci-go-sdk/v42 v42.0.0 // indirect
pavan@localhost:~/Pavan/gowork/src$
pavan@localhost:~/Pavan/gowork/src$ echo $GOPATH
/home/pavan/go
‘’’

I am unable to use the go module. The sdk is downloaded using the command
‘’’ go get github.com/oracle/oci-go-sdk/v42 ‘’’

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.