{"modulePath":"github.com/acoderup/goctl","version":"v1.1.7","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package util\n\n## Constants\n\n```go\nconst (\n\t// DoNotEditHead added to the beginning of a file to prompt the user not to edit\n\tDoNotEditHead = \"// Code generated by goctl. DO NOT EDIT.\"\n)\n```\n\n## Functions\n\n```go\nfunc CloneIntoGitHome(url, branch string) (dir string, err error)\n```\n\n```go\nfunc EscapeGolangKeyword(s string) string\n```\nEscapeGolangKeyword escapes the golang keywords.\n\n```go\nfunc FieldsAndTrimSpace(s string, f func(r rune) bool) []string\n```\n\n```go\nfunc GetHead(source string) string\n```\nGetHead returns a code head string with source filename\n\n```go\nfunc Index(slice []string, item string) int\n```\nIndex returns the index where the item equal,it will return -1 if mismatched Deprecated: use slices.Index instead\n\n```go\nfunc IsEmptyStringOrWhiteSpace(s string) bool\n```\n\n```go\nfunc IsTemplateVariable(text string) bool\n```\nIsTemplateVariable returns true if the text is a template variable. The text must start with a dot and be a valid template.\n\n```go\nfunc SafeString(in string) string\n```\nSafeString converts the input string into a safe naming style in golang\n\n```go\nfunc TemplateVariable(text string) string\n```\nTemplateVariable returns the variable name of the template.\n\n```go\nfunc Title(s string) string\n```\nTitle returns a string value with s\\[0] which has been convert into upper case that there are not empty input text\n\n```go\nfunc TrimWhiteSpace(s string) string\n```\n\n```go\nfunc Untitle(s string) string\n```\nUntitle returns a string value with s\\[0] which has been convert into lower case that there are not empty input text\n\n## Types\n\n```go\ntype DefaultTemplate struct {\n\t// contains filtered or unexported fields\n}\n```\nDefaultTemplate is a tool to provides the text/template operations\n\n```go\nfunc With(name string) *DefaultTemplate\n```\nWith returns an instance of DefaultTemplate\n\n```go\nfunc (t *DefaultTemplate) Execute(data any) (*bytes.Buffer, error)\n```\nExecute returns the codes after the template executed\n\n```go\nfunc (t *DefaultTemplate) GoFmt(format bool) *DefaultTemplate\n```\nGoFmt sets the value to goFmt and marks the generated codes will be formatted or not\n\n```go\nfunc (t *DefaultTemplate) Parse(text string) *DefaultTemplate\n```\nParse accepts a source template and returns DefaultTemplate\n\n```go\nfunc (t *DefaultTemplate) SaveTo(data any, path string, forceUpdate bool) error\n```\nSaveTo writes the codes to the target path\n\n","path":"github.com/acoderup/goctl/util","name":"util","synopsis":"","isRedistributable":true}
