-------------------------------------------------------------------------------------------------------------------------------------

如果demo目录下有两个文件 main.go 和mian2.go的话,main.go 和main2.go文件中的package 定义的名字要是同一个

不同的话,是会报错的。

 




main2.go




main2.go 中的package main2 改为 main就是可以的。

 

​myproject.go​

Go code must be kept inside a workspace. A workspace is a directory hierarchy with three directories at its root:

src contains Go source files organized into packages (one package per directory),

pkg contains package objects, and

bin contains executable commands.