Golang

go: cannot find main module error

느리지만 꾸준하게 2021. 12. 11. 17:13

vscode에서 golang 자동완성이 안될 때 여기 tistory를 참고를 했다.

go: cannot find main module, but found .git/config in C:\Users\kjh
	to create a module there, run:
	cd ..\..\.. && go mod init

settings.json을 아래와 같이 설정을 해주었다.

이후에 에러가 뜬다,,

go: cannot find main module, but found .git/config in C:\Users\kjh
to create a module there, run:
cd ..\..\.. && go mod init

 

F1키 - settings.json을 들어가서 위에 설정을 다시해주니까 맨우측 하단에 Install이 몇개 설치되고 error 해결완료

package main

import "fmt"

func main() {
	fmt.Println("Hello world")
}

 

 

'Golang' 카테고리의 다른 글

if & switch  (0) 2021.12.12
for&range&args  (0) 2021.12.12
Functions (2)  (0) 2021.12.11
Functions (1)  (0) 2021.12.11
Go 들어가기에 앞서 Building 내용  (0) 2021.12.11