gocode

package
v0.0.0-...-3e6eb1a Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 6, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewDocMap

func NewDocMap(fset *token.FileSet, file *ast.File) map[ast.Node]*ast.CommentGroup

NewDocMap creates a map associating AST nodes (structs and fields) with their documentation comments that are immediately above them.

Types

type GoStruct

type GoStruct struct {
	GoPackage string
	Name      string
	Fields    []*StructField

	Comments []string
}

func (*GoStruct) GetAnnotation

func (s *GoStruct) GetAnnotation(key string) string

type Package

type Package struct {
	GoPackage string
	SourceDir string

	Structs []*GoStruct

	Comments []string
}

func LoadPackage

func LoadPackage(goPackage string, path string) (*Package, error)

func LoadPackageTree

func LoadPackageTree(goPackage string, basePath string) ([]*Package, error)

func (*Package) GetAnnotation

func (p *Package) GetAnnotation(key string) string

type StructField

type StructField struct {
	Name string
	Type string
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL