我在 /etc/profile 下
已经设置了工作目录
```golang
export GOROOT=/usr/local/go
export PATH="$PATH:$GOROOT/bin:$GOPATH/bin"
export GOPATH=/home/liu/go
```
并且把代码目录设置在了`/home/liu/go/src `文件下面
![3bfde76a901bc007a4cd7b472ffbf43.jpg](https://static.golangjob.cn/230419/a5a683a9a9035e75c8c918c07fb4a8f3.jpg)
**划线的路径已经确保是正确路径,但是还是找不到包的位置,不知道为啥。**
导入路径不存在`/gocode/...`的形式。
你想表达的意思应该是
```go
import "./gocode/..."
```
或者
```go
import "../gocode/..."
```
#2
更多评论
```go
GO111MODULE="off"
GOARCH="amd64"
GOBIN=""
GOCACHE="/home/liu/.cache/go-build"
GOENV="/home/liu/.config/go/env"
GOEXE=""
GOEXPERIMENT=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOINSECURE=""
GOMODCACHE="/home/liu/go/pkg/mod"
GONOPROXY=""
GONOSUMDB=""
GOOS="linux"
GOPATH="/home/liu/go"
GOPRIVATE=""
GOPROXY="https://mirrors.aliyun.com/goproxy/"
GOROOT="/usr/local/go"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/local/go/pkg/tool/linux_amd64"
GOVCS=""
GOVERSION="go1.20.3"
GCCGO="gccgo"
GOAMD64="v1"
AR="ar"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD=""
GOWORK=""
CGO_CFLAGS="-O2 -g"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-O2 -g"
CGO_FFLAGS="-O2 -g"
CGO_LDFLAGS="-O2 -g"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -Wl,--no-gc-sections -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build3663553553=/tmp/go-build -gno-record-gcc-switches"
```
#1