gen

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Jun 12, 2022 License: BSD-3-Clause Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Repackage

func Repackage(inFile, outFile, pkg string)

Repackage copies the given inFile to outFile adjusting the to the given package name. It assumes that the given inFile is in package main, panics otherwise.

func WriteGo

func WriteGo(w io.Writer, pkg, tags string, b []byte) (n int, err error)

func WriteGoFile

func WriteGoFile(filename, pkg string, b []byte) (n int)

WriteGoFile writes the go file with the given filename and pkg, and returns the size of the bytes written

Types

type Writer

type Writer struct {
	Size int
	Hash hash.Hash32 // content hash
	// contains filtered or unexported fields
}

func NewWriter

func NewWriter() *Writer

func (*Writer) Write

func (w *Writer) Write(p []byte) (n int, err error)

func (*Writer) WriteArray

func (w *Writer) WriteArray(x any)

func (*Writer) WriteComment

func (w *Writer) WriteComment(comment string, args ...any)

func (*Writer) WriteConst

func (w *Writer) WriteConst(name string, x any)

func (*Writer) WriteGo

func (w *Writer) WriteGo(out io.Writer, pkg, tags string) (n int, err error)

func (*Writer) WriteGoFile

func (w *Writer) WriteGoFile(filename, pkg string) (n int)

WriteGoFile writes the go file with the given filename and pkg, and returns the size of the bytes written

func (*Writer) WriteSlice

func (w *Writer) WriteSlice(x any)

func (*Writer) WriteString

func (w *Writer) WriteString(s string)

func (*Writer) WriteType

func (w *Writer) WriteType(x any) string

func (*Writer) WriteVar

func (w *Writer) WriteVar(name string, x any)

Jump to

Keyboard shortcuts

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