1. expected “;”,found “import”2. package Solution is not in GOROOT (…) 1. expected “;”,found “import”运行 Go 文件时,报s上述错误。解决办法:需要在头部添加 package main 语句。 2. package Solution is not in GOROOT (…)解决办法:项目文件缺少 go.mod 文件,在与项目同级目录下,执行 go mod init powerOfThree 即可, 参考文档: https://www.cnblogs.com/brady-wang/p/13069053.html https://blog.csdn.net/demon_xi/article/details/119357779