[Golang] VSCode에서 go: go.mod file not found in current directory or any parent directory; see 'go help modules' 해결하기

김나윤·2024년 5월 31일
0

Golang

목록 보기
1/1

에러 메시지

go: go.mod file not found in current directory or any parent directory; see 'go help modules

Golang을 설치하고 cmd로 잘 설치된 것까지 확인했는데
왜 hello 찍어보려고 하는데 오류가 뜨는 걸까...
시작부터 빨간 글씨가 잔뜩인 걸 보고 눈을 질끈 감았지만 대략적으로 하는 말이 go.mode파일이 없어서 뜨는 것 같아 구글에 검색하니 바로 해결 방법이 나왔다.

vscode 터미널에서

  • go env -w GO111MODULE=auto

이렇게 입력해보니 제대로 결과가 찍히는 것을 확인할 수 있었다.

출처 https://banjubu.tistory.com/130

profile
Hello, world!

0개의 댓글