Skip to content

Instantly share code, notes, and snippets.

@wenLiangcan
Last active January 3, 2016 07:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wenLiangcan/8432721 to your computer and use it in GitHub Desktop.
Save wenLiangcan/8432721 to your computer and use it in GitHub Desktop.
//测试代码
package test
import "fmt"
func main()
{
fmt.Printf("test\n")
}
//执行
$ gofmt -w test.go
test.go:6:1: expected declaration, found '{'
//然后源文件并没有被修正,请问是什么原因呢?
@kalenderApp
Copy link

貌似首先要保证你写的语法正确吧?

@wenLiangcan
Copy link
Author

添加了 import 还是不行

@patricksuo
Copy link

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