Last active
January 3, 2016 07:59
-
-
Save wenLiangcan/8432721 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//测试代码 | |
package test | |
import "fmt" | |
func main() | |
{ | |
fmt.Printf("test\n") | |
} | |
//执行 | |
$ gofmt -w test.go | |
test.go:6:1: expected declaration, found '{' | |
//然后源文件并没有被修正,请问是什么原因呢? |
添加了 import 还是不行
package test
import "fmt"
func main() {
fmt.Printf("test\n")
}
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
貌似首先要保证你写的语法正确吧?