gen

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2019 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Capitalize

func Capitalize(s string) string

Capitalize helper

func Format

func Format(input string) (output string, err error)

Format the output using goimports

func FormatAll

func FormatAll(dir string) (err error)

FormatAll formats by a path overwriting the original file

func Generate

func Generate(name string, data interface{}, tpl string) (string, error)

Generate function

func Identifier

func Identifier(s string) string

Identifier from the string avoiding the builtins

func IsBuiltin

func IsBuiltin(name string) bool

IsBuiltin checks if the name is builtin

func Join

func Join(a []string) string

Join just joins 2 strings by commas

func JoinV

func JoinV(vts []Vartype) string

JoinV joins vartypes just by the var

func JoinVT

func JoinVT(vts []Vartype) string

JoinVT joins vartypes var and type

func Lowercase

func Lowercase(s string) string

Lowercase fn

func Pointer

func Pointer(s string) string

Pointer returns a pointer version of the variable

func Sequence

func Sequence(until int) []string

Sequence counts up until a number starting at $1

func VT

func VT(vt Vartype) string

VT turns a vartype into a string

func Variable

func Variable(s string) string

Variable creates a short variable from the string

Types

type File

type File struct {
	Name   string
	Source string
}

File that's been generated

type Vartype

type Vartype struct {
	Var      string
	Type     string
	Optional bool
}

Vartype struct

Jump to

Keyboard shortcuts

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