func readFile(filename string) (hasMain bool, err error) {
	var src []byte
	src, err = ioutil.ReadFile(filename)
	if err != nil {
		return
	}
	fset := token.NewFileSet()
	file, err := parser.ParseFile(fset, filename, src, 0)
	for _, decl := range file.Decls {
		funcDecl, ok := decl.(*ast.FuncDecl)
		if !ok {
			continue
		}
		if !isMain(funcDecl) {
			continue
		}
		hasMain = true
		break
	}
	return
}
func readFile(filename string) (hasMain bool, err error) {
	var src []byte
	src, err = ioutil.ReadFile(filename)
	if err != nil {
		return
	}
	fset := token.NewFileSet()
	file, err := parser.ParseFile(fset, filename, src, 0)
	for _, decl := range file.Decls {
		funcDecl, ok := decl.(*ast.FuncDecl)
		if !ok {
			continue
		}
		if !isMain(funcDecl) {
			continue
		}
		hasMain = true
		break
	}
	return
}
func readFile ( filename string ) ( hasMain bool , err error ) { var src [ ] byte src , err = ioutil . ReadFile ( filename ) if err != nil { return } fset := token . NewFileSet ( ) file , err := parser . ParseFile ( fset , filename , src , 0 ) for _ , decl := range file . Decls { funcDecl , ok := decl . ( * ast . FuncDecl ) if ! ok { continue } if ! isMain ( funcDecl ) { continue } hasMain = true break } return }
// readFile reads and parses the Go source code file and returns whether it has a main function.
readFile reads and parses the Go source code file and returns whether it has a main function .