zstdzgo.at/zstd/zgo Index | Files

package zgo

import "zgo.at/zstd/zgo"

Package zgo provides functions to work with Go source files.

Index

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

func PredeclaredType(n string) bool

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

func StarExpr(e ast.Expr) (ast.Expr, bool)

StarExpr resolves *ast.StarExpr

func Tag

func Tag(f *ast.Field, n string) (string, []string)

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

func TagName(f *ast.Field, n string) string

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.