반응형

current directory is contained in a module that is not one of the workspace modules listed in go.work. You can add the module to the workspace using:

* Mac

* vscode

* Golang 1.20

 

상황

go mod init 한 후 go build 했을 때 발생했습니다.

 

해결

go build 하기 전에 gopls 설정을 했기 때문에 거기서 발생한 문제 일수 있어 들어가 봤더니 필요 없는 구문이 적혀있어 제거 후 VSCode를 재실행 했습니다.

재실행 후 잘 작동합니다.

 

반응형

+ Recent posts