0

I started using direnv recently.

I created a .envrc file in my project’s root directory.

There is only one line in .envrc:

export GOPATH=$(pwd)

I use vim with coc & gopls to write go, but when I open main.go coc shows this error

Error [compiler] could not import os (no package for import os)

This is my project structure

.
├── .envrc
├── bin -> /root/go/bin
├── out
├── pkg -> /root/go/pkg
└── src
    ├── github.com -> /root/go/src/github.com
    ├── golang.org -> /root/go/src/golang.org
    └── monkey
        ├── lexer
        │   ├── lexer.go
        │   └── lexer_test.go
        ├── main.go
        ├── out
        ├── repl
        │   └── repl.go
        └── token
            └── token.go

4

0 回答 0