Hi I'm pretty new at Golang, after install it I would like to use the next package in my project: https://github.com/gin-gonic/gin
After I created my project, I did the next command to install gingonic:
go get -u github.com/gin-gonic/gin
But the import is not recognized inside my project, I understand that it's something related with my GOROOT, but I wasn't able to solve the issue.
The next are are my Go env variables:
GO111MODULE="on"
GOARCH="amd64"
GOBIN=""
GOCACHE="/Users/rpantoja/Library/Caches/go-build"
GOENV="/Users/rpantoja/Library/Application Support/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOINSECURE=""
GOMODCACHE="/Users/rpantoja/go/pkg/mod"
GONOPROXY="github.com/mercadolibre"
GONOSUMDB="github.com/mercadolibre"
GOOS="darwin"
GOPATH="/Users/rpantoja/go"
GOPRIVATE="github.com/mercadolibre"
GOPROXY="http://goregistry.furycloud.io/"
GOROOT="/usr/local/Cellar/go/1.15/libexec"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/local/Cellar/go/1.15/libexec/pkg/tool/darwin_amd64"
GCCGO="gccgo"
AR="ar"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD="/dev/null"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/gz/zfy97n595rs5w_t0dr9wr29dzzxvs4/T/go-build960054223=/tmp/go-build -gno-record-gcc-switches -fno-common"
And this is how my project it's configured:
After install the package:
go init
the module file in the root of the project? – Margach ChrisOption+Enter
shortcut, then choosego get ...
– s0xzwasdgo mod init
in built-in Terminal, then disable GOPATH indexing (Preferences | Go | GOPATH | Index entire GOPATH
) and hover over import,Option+Enter
, Sync Dependencies... – s0xzwasd