enumerate

package
v0.0.0-...-3005140 Latest Latest
Warning

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

Go to latest
Published: Sep 26, 2025 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type File

type File struct {
	Pkg         *Package
	File        *ast.File
	TypeName    string
	TypeComment string
	Type        string
	IsString    bool
	Values      []*Value
	OmitZero    bool
}

func (*File) GenDecl

func (f *File) GenDecl(node ast.Node) bool

GenDecl processes one declaration clause.

type Package

type Package struct {
	Name  string
	Defs  map[*ast.Ident]types.Object
	Files []*File
}

type SortValues

type SortValues []*Value

SortValues 使我们可以将`constants`进行排序 字符串不排序, 整型谨慎地按照有符号或无符号的顺序进行恰当的排序

func (SortValues) ArrayString

func (vs SortValues) ArrayString() string

ArrayString convert to array string format [0:aaa,1:bbb,3:ccc]

func (SortValues) Clone

func (vs SortValues) Clone() SortValues

func (SortValues) Len

func (b SortValues) Len() int

func (SortValues) Less

func (b SortValues) Less(i, j int) bool

func (SortValues) Swap

func (b SortValues) Swap(i, j int)

type Value

type Value struct {
	OriginalName string // 常量定义的名称
	Label        string // 注释, 如果没有, 则同常量名称
	// value相关
	Value    uint64 // 需要时转为`int64`(integer有效).
	Signed   bool   // `constant`是否是有符号类型(integer有效),
	RawValue string // 纯值, 字符串不包含引号, 整型直接格式化成字符串
	IsString bool   // 是否是string, 否则为integer
	Val      string // `constant`的字符串值,由"go/constant"包提供.
}

Value represents a declared constant.

func (*Value) String

func (v *Value) String() string

Jump to

Keyboard shortcuts

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