Hello go bridgers, I have a problem with importing packages to golang workspace.
I am trying to import a package from within the same project directory but it’s not loading. Here’s the folder structure:
main.go (package main)
demo.go (package demo)
When I try to load load the
demo package in main, it shows an error like:
[go] cannot find package "mypackage/demo" in any of: /usr/local/go/src/mypackage/demo (from $GOROOT) /home/me/work/src/mypackage/demo (from $GOPATH)
My import in
main.go goes like this:
Why am I getting this kind of error and how do I fix that
Sorry for unformated text, I’m new here, Thank you.