non-declaration statement outside function body错误

这个觉得Google出来的好多说的不是特别清楚,后来在StackOverflow上看到一个答案:the tour of go解释为什么出这个错:
https://tour.golang.org/basics/10
意思就是在func外,每个语句都必须是golang的关键字开始,否则就报这个错.

原文地址:https://www.cnblogs.com/ls11736/p/13878933.html