Help us shape the future of Go! Take the 2026 Go Developer Survey

writer

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Jan 23, 2026 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Options

type Options struct {
	// RepoDir   string
	// OutDir    string
	CompilerPath string
}

type Writer

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

func NewWriter

func NewWriter(opts Options) *Writer

func (*Writer) CreateFile

func (p *Writer) CreateFile(fi *uniast.File, mod *uniast.Module) ([]byte, error)

func (*Writer) GetGoVersion

func (w *Writer) GetGoVersion() (string, error)

func (*Writer) IdToImport

func (w *Writer) IdToImport(id uniast.Identity) (uniast.Import, error)

func (*Writer) PatchImports

func (p *Writer) PatchImports(impts []uniast.Import, file []byte) ([]byte, error)

func (Writer) SplitImportsAndCodes

func (w Writer) SplitImportsAndCodes(src string) (codes string, imports []uniast.Import, err error)

receive a piece of golang code, parse it and splits the imports and codes

func (*Writer) WriteModule

func (w *Writer) WriteModule(repo *uniast.Repository, modPath string, outDir string) error

func (*Writer) WriteRepo

func (w *Writer) WriteRepo(repo *uniast.Repository, outDir string) error

Jump to

Keyboard shortcuts

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