codegen

package
v0.6.1 Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2025 License: MIT Imports: 10 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 {
	// contains filtered or unexported fields
}

File represents a generated Go file.

func NewFile

func NewFile(filename string) *File

NewFile creates a new File with the given filename.

func (*File) Content

func (g *File) Content() ([]byte, error)

Content returns the contents of the generated file.

func (*File) Filename added in v0.5.0

func (g *File) Filename() string

Filename returns the filename of the file.

func (*File) Import

func (g *File) Import(importPath string)

Import adds an import to the file.

func (*File) P

func (g *File) P(v ...any)

P writes a line of code to the file.

func (*File) Write

func (g *File) Write(p []byte) (n int, err error)

Write implements io.Writer.

Jump to

Keyboard shortcuts

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