printer

package
v0.0.0-...-8d2871e Latest Latest
Warning

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

Go to latest
Published: May 10, 2021 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Print

func Print(out io.Writer, ifaces []*token.Interface, opts ...PrintOption) error

Print generates code for the provided interfaces and writes it to out.

Types

type PrintOption

type PrintOption func(p *printer)

PrintOption is a Print configuration option.

func WithGofmt

func WithGofmt(enable bool) PrintOption

WithGofmt gofmts generated code, enabled by default.

Not recommended to disable it, only for debugging the output, because gofmt works as a validation step as well.

func WithPackageName

func WithPackageName(name string) PrintOption

WithPackageName overrides the package name of generated code.

func WithPrefixes

func WithPrefixes(prefixes []string) PrintOption

WithPrefixes prefixes to strip from interface names, be careful when using it may lead to compilation errors.

Jump to

Keyboard shortcuts

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