genutils

package
v0.6.7 Latest Latest
Warning

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

Go to latest
Published: May 2, 2021 License: ISC Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateExternType

func GenerateExternType(root string, t Qualer) jen.Code

GenerateExternType generates a jen.Qual from the given Qualer, except if the path is empty, root is used instead.

func GenerateType

func GenerateType(t Qualer) jen.Code

GenerateType generates a jen.Qual from the given Qualer.

func NewFile added in v0.2.12

func NewFile(pkgname string) *jen.File

NewFile creates a new file with the appropriate header comments.

func NewFilePath added in v0.2.12

func NewFilePath(pkgpath string) *jen.File

NewFilePath creates a new file with the appropriate header comments.

func RecvName

func RecvName(name string) string

RecvName is used to get the receiver variable name. It returns the first letter lower-cased. It does NOT do length checking. It only works with ASCII.

Types

type Qualer

type Qualer interface {
	Qual() (path, name string)
}

Jump to

Keyboard shortcuts

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