Golang go/ast.PackageExports() function example
package go/ast
PackageExports trims the AST for a Go package in place such that only exported nodes remain. The pkg.Files list is not changed, so that file names and top-level package comments don't get lost.
PackageExports returns true if there are exported declarations; it returns false otherwise.
Golang go/ast.PackageExports() function usage example
var astFile *ast.File
var filename string
astPkg := ast.Package{
Name : "test",
Files : map[string]*ast.File {
filename : astFile,
},
}
ast.PackageExports(&astPkg)
Reference :
Advertisement
Something interesting
Tutorials
+4.7k Golang : How to pass data between controllers with JSON Web Token
+6.3k Golang : Selection sort example
+10.2k Golang : Find and replace data in all files recursively
+6.3k Unix/Linux : Use netstat to find out IP addresses served by your website server
+6.1k Fix ERROR 2003 (HY000): Can't connect to MySQL server on 'IP address' (111)
+14.1k Javascript : Prompt confirmation before exit
+11k Golang : Create Temporary File
+19.1k Golang : Display list of time zones with GMT
+18.7k Golang : Iterating Elements Over A List
+7.1k Golang : Squaring elements in array
+5.7k Golang : Struct field tags and what is their purpose?