Go to the stepped pit entry: can not find package "" in any of

Question: can not find package "" in any of. Has now been resolved in accordance blog, share one kind of stepped on his own pit welcome the god guide the exchange!

The first to use most of the cases go env view the current environment variables, beginners can not find the package appears that environmental environment. Just need to focus GOROOT and GOPATH can be.

  1. GOROOT: GO is simply the installation directory, this has little effect.
  2. GOPATH: GO represents the working directory, the situation can not find the package appears big probability is a problem here.
    Here Insert Picture Description
  3. bin: binary files compiled formed.
  4. pkg: After compiling the package file location.
  5. src: source location. His clone down the source code in the position of running this situation can be resolved not find the package.
    Here Insert Picture Description
    Or when building his new project also go directly to the src directory under GOPATH, many paths to avoid problems.
    Here Insert Picture Description
Original Address: https: //blog.csdn.net/aaaaaab_/article/details/99690341

Guess you like

Origin www.cnblogs.com/jpfss/p/11781366.html