1.问题一:
build command-line-arguments: cannot find module for path _/D_/tom/project/Demo/Script/main/helloworld
解:
2.问题二:
main.go:6:2: no required module provides package github.com/gin-gonic/gin: go.mod file not found in current directory or any parent directory; see 'go help modules'
解:go mod init projectname
3、解决go run: cannot run non-main package异常
异常信息:
go run: cannot run non-main package
异常原因:
在Go语言中, 只有package为main时才能执行main方法