gen

package
v0.0.0-...-c9caf7a Latest Latest
Warning

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

Go to latest
Published: Jul 14, 2020 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Comment

func Comment(str string) string

Comment assembles a string with correct newlines and // at the beginning of each line

func ModRootDir

func ModRootDir() (string, error)

ModRootDir returns the root directory of current module. If the current working directory is not a module returns an error.

func Public

func Public(str string) string

Public ensures that str starts with an uppercase letter

func SlashToCamelCase

func SlashToCamelCase(str string) string

SlashToCamelCase makes from /my/path a string like MyPath

func SortedKeys

func SortedKeys(m interface{}) []string

SortedKeys is missing generics very badly, m is actually map[string]<T>

Types

type GoGenFile

type GoGenFile struct {
	// contains filtered or unexported fields
}

func NewGoGenFile

func NewGoGenFile(importPath, generatorName string) *GoGenFile

func (*GoGenFile) FormatString

func (w *GoGenFile) FormatString() string

func (*GoGenFile) HasImport

func (w *GoGenFile) HasImport(importPath string) bool

func (*GoGenFile) HasImportAlias

func (w *GoGenFile) HasImportAlias(importPath string) bool

func (*GoGenFile) Import

func (w *GoGenFile) Import(importPath string) string

func (*GoGenFile) ImportName

func (w *GoGenFile) ImportName(importPath string, name string) string

func (*GoGenFile) Indent

func (w *GoGenFile) Indent(i int)

func (*GoGenFile) Printf

func (w *GoGenFile) Printf(str string, args ...interface{})

func (*GoGenFile) ShiftLeft

func (w *GoGenFile) ShiftLeft()

func (*GoGenFile) ShiftRight

func (w *GoGenFile) ShiftRight()

func (*GoGenFile) String

func (w *GoGenFile) String() string

Jump to

Keyboard shortcuts

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