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 IsLowerCase(r rune) bool
- func IsUpperCase(r rune) bool
- func SafeString(in string) string
- func Title(s string) string
- func ToCamelCase(s string) string
- func ToLower(s string) string
- func ToLowerCase(r rune) rune
- func ToSnakeCase(s string) string
- func ToUpper(s string) string
- func ToUpperCase(r rune) rune
- func UnExport(text string) bool
- func Untitle(s string) string
- func UpperFirst(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 go-smart. 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
func Title ¶
Title returns a string value with s[0] which has been convert into upper case that there are not empty input text
func ToCamelCase ¶
ToCamelCase returns a copy string by converting snake case into camel case
func ToSnakeCase ¶
ToSnakeCase returns a copy string by converting camel case into snake case
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.