// FileExports trims the AST for a Go source file in place such that only
// exported nodes remain: all top-level identifiers which are not exported
// and their associated information (such as type, initial value, or function
// body) are removed. Non-exported fields and methods of exported types are
// stripped, and the function bodies of exported functions are set to nil.
// The File.comments list is not changed.
//
// FileExports returns true if there is an exported declaration; it returns
// false otherwise.
//

FileExports trims the AST for a Go source file in place such that only
exported nodes remain: all top-level identifiers which are not exported
and their associated information (such as type, initial value, or function
body) are removed. Non-exported fields and methods of exported types are
stripped, and the function bodies of exported functions are set to nil.
The File.comments list is not changed.

FileExports returns true if there is an exported declaration; it returns
false otherwise.
// FileExports trims the AST for a Go source file in place such that only // exported nodes remain : all top - level identifiers which are not exported // and their associated information ( such as type initial value or function // body ) are removed . Non - exported fields and methods of exported types are // stripped and the function bodies of exported functions are set to nil . // The File . comments list is not changed . // // FileExports returns true if there is an exported declaration ; it returns // false otherwise . //
func FileExports(src *File) bool {
	j := 0
	for _, d := range src.Decls {
		if declExports(d) {
			src.Decls[j] = d
			j++
		}
	}
	src.Decls = src.Decls[0:j]
	return j > 0
}
func FileExports ( src * File ) bool { j := 0 for _ , d := range src . Decls { if declExports ( d ) { src . Decls [ j ] = d j ++ } } src . Decls = src . Decls [ 0 : j ] return j > 0 }
FileExports trims the AST for a Go source file in place such that only
exported nodes remain: all top-level identifiers which are not exported
and their associated information (such as type, initial value, or function
body) are removed.
FileExports trims the AST for a Go source file in place such that only exported nodes remain : all top - level identifiers which are not exported and their associated information ( such as type initial value or function body ) are removed .