package zgo
import "zgo.at/zstd/zgo"
Package zgo provides functions to work with Go source files.
Index ¶
- func ModuleRoot() string
- func PredeclaredType(n string) bool
- func StarExpr(e ast.Expr) (ast.Expr, bool)
- func Tag(f *ast.Field, n string) (string, []string)
- func TagName(f *ast.Field, n string) string
Functions ¶
func ModuleRoot ¶
func ModuleRoot() string
ModuleRoot gets the full path to the module root directory.
Returns empty string if it can't find a module.
func PredeclaredType ¶
PredeclaredType reports if a type is a predeclared built-in type.
Note that this excludes composite types, such as maps, slices, channels, etc.
https://golang.org/ref/spec#Predeclared_identifiers
func StarExpr ¶
StarExpr resolves *ast.StarExpr
func Tag ¶
Tag gets the tag name for a struct field and all attributes.
It will return the struct field name if there is no tag. This function does not do any validation on the tag format. Use go vet!
func TagName ¶
TagName gets the tag name for a struct field without any attributes.
It will return the struct field name if there is no tag. This function does not do any validation on the tag format. Use go vet!
Source Files ¶
zgo.go
- Version
- v0.0.0-20240930202209-a63c3335042a (latest)
- Published
- Sep 30, 2024
- Platform
- linux/amd64
- Imports
- 6 packages
- Last checked
- 2 days ago –
Tools for package owners.