Written on
·
285
·
Edited
0
go env
set GOBIN=C:\go_study\bin
set GOROOT=C:\Program Files\Go
set GOPATH=C:\go_study
PS C:\go_study\src\section1> go run main
cannot find package "main" in any of:
C:\Program Files\Go\src\main (from $GOROOT)
C:\go_study\src\main (from $GOPATH)
관련된 에러가 나고 있습니다.
이유를 잘모르겠습니다.
PS C:\go_study\src\section1> go mod init main
go: creating new go.mod: module main
go: to add module requirements and sums:
go mod tidy
PS C:\go_study\src\section1> go mod tidy
PS C:\go_study\src\section1> go run main
helloworld.go:1:1: expected 'package', found pakcage
visual studio일 경우에는 어떻게 해결하나요?
Answer 1
0