Documentation ¶
Index ¶
- Constants
- func CloneIntoGitHome(url, branch string) (dir string, err error)
- func EscapeGolangKeyword(s string) string
- func GetHead(source string) string
- func Index(slice []string, item string) int
- func SafeString(in string) string
- func Title(s string) string
- func Untitle(s string) string
- type DefaultTemplate
Constants ¶
View Source
const (
// DoNotEditHead added to the beginning of a file to prompt the user not to edit
DoNotEditHead = "// Code generated by goctl. DO NOT EDIT."
)
Variables ¶
This section is empty.
Functions ¶
func CloneIntoGitHome ¶
func EscapeGolangKeyword ¶
EscapeGolangKeyword escapes the golang keywords.
func SafeString ¶
SafeString converts the input string into a safe naming style in golang
Types ¶
type DefaultTemplate ¶
type DefaultTemplate struct {
// contains filtered or unexported fields
}
DefaultTemplate is a tool to provides the text/template operations
func (*DefaultTemplate) Execute ¶
func (t *DefaultTemplate) Execute(data interface{}) (*bytes.Buffer, error)
Execute returns the codes after the template executed
func (*DefaultTemplate) GoFmt ¶
func (t *DefaultTemplate) GoFmt(format bool) *DefaultTemplate
GoFmt sets the value to goFmt and marks the generated codes will be formatted or not
func (*DefaultTemplate) Parse ¶
func (t *DefaultTemplate) Parse(text string) *DefaultTemplate
Parse accepts a source template and returns DefaultTemplate
Directories ¶
Path | Synopsis |
---|---|
Package name provides methods to verify naming style and format naming style See the method IsNamingValid, FormatFilename
|
Package name provides methods to verify naming style and format naming style See the method IsNamingValid, FormatFilename |
Click to show internal directories.
Click to hide internal directories.