file

package
v1.2.40 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	CommentBeforePackage = "before:package"
	CommentBeforeImport  = "before:import"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Go added in v1.2.15

type Go struct {
	GoSrc
	GoDst
}

func NewGoFile added in v1.2.15

func NewGoFile() *Go

func ReadGo added in v1.2.15

func ReadGo(filePath string) *Go

func (*Go) PackageOf added in v1.2.15

func (f *Go) PackageOf(packageOf string) *Go

func (*Go) TrimComment added in v1.2.15

func (f *Go) TrimComment() *Go

func (*Go) WriteTo added in v1.2.15

func (f *Go) WriteTo(dstFilePath string)

type GoDst added in v1.2.15

type GoDst struct {
	Comments map[string][]string
}

type GoSrc added in v1.2.15

type GoSrc struct {
	// package xxx
	Package string

	// import ""
	// import ()
	Import []string

	// Text Contain Comment
	Text    []string
	Comment []string
}

type Reader added in v1.2.15

type Reader struct {
	// contains filtered or unexported fields
}

func NewReader added in v1.2.15

func NewReader(filePath string) *Reader

func (*Reader) Done added in v1.2.15

func (r *Reader) Done()

func (*Reader) NextByte added in v1.2.15

func (r *Reader) NextByte(b *byte) bool

func (*Reader) NextByte2 added in v1.2.15

func (r *Reader) NextByte2() (b byte, hasNext bool)

func (*Reader) NextLine added in v1.2.15

func (r *Reader) NextLine(s *string) bool

func (*Reader) NextLine2 added in v1.2.15

func (r *Reader) NextLine2() (lineStr string, hasNext bool)

func (*Reader) NextRune added in v1.2.15

func (r *Reader) NextRune(un *rune) bool

func (*Reader) NextRune2 added in v1.2.15

func (r *Reader) NextRune2() (un rune, hasNext bool)

type Writer

type Writer struct {
	// contains filtered or unexported fields
}

func CodeGen

func CodeGen(filePath string) *Writer

func NewWriter added in v1.2.15

func NewWriter(filePath string) *Writer

func (*Writer) Done

func (w *Writer) Done()

func (*Writer) Line

func (w *Writer) Line() *Writer

func (*Writer) SkipSpace added in v1.2.15

func (w *Writer) SkipSpace() *Writer

func (*Writer) Word

func (w *Writer) Word(s ...string) *Writer

func (*Writer) Words

func (w *Writer) Words(s ...string) *Writer

func (*Writer) WordsSep added in v1.2.15

func (w *Writer) WordsSep(sep string, s ...string) *Writer

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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