./slice.go:5:1: syntax error: non-declaration statement outside function body
意思就是在func外,每个语句都必须是golang的关键字开始,否则就报这个错,写在函数体内就好。
这应该也是一种可以的解决方案
syntax error: non-declaration statement outside function body_小马过河-CSDN博客
./slice.go:5:1: syntax error: non-declaration statement outside function body
意思就是在func外,每个语句都必须是golang的关键字开始,否则就报这个错,写在函数体内就好。
这应该也是一种可以的解决方案
syntax error: non-declaration statement outside function body_小马过河-CSDN博客