Documentation ¶
Index ¶
- Constants
- func AskForConfirmation() bool
- func CamelCase(in string) string
- func CamelString(s string) string
- func CheckEnv(appname string) (apppath, packpath string, err error)
- func CloseFile(f *os.File)
- func EndLine() string
- func FILE() string
- func FormatSourceCode(filename string)
- func GetFileModTime(path string) int64
- func GetGOPATHs() []string
- func GetGoVersionSkipMinor() string
- func GetradicalWorkPath() string
- func Go(f func() error) chan error
- func GoCommand(command string, args ...string) error
- func IsExist(path string) bool
- func IsGOMODULE() bool
- func IsInGOPATH(thePath string) bool
- func IsradiantProject(thePath string) bool
- func LINE() int
- func MacOSVersionSupport() bool
- func MustCheck(err error)
- func NoticeUpdateradical()
- func Notify(text, title string)
- func PrintErrorAndExit(message, errorTemplate string)
- func RadicalFuncMap() template.FuncMap
- func SearchGOPATHs(app string) (bool, string, string)
- func SnakeString(s string) string
- func SplitQuotedFields(in string) []string
- func Tmpl(text string, data interface{})
- func TmplToString(tmpl string, data interface{}) string
- func WriteToFile(filename, content string)
- type DocValue
- type ListOpts
- type StrFlags
Constants ¶
const Radiant_VERSION = "v1.0.14"
Variables ¶
This section is empty.
Functions ¶
func AskForConfirmation ¶
func AskForConfirmation() bool
askForConfirmation uses Scanln to parse user input. A user must type in "yes" or "no" and then press enter. It has fuzzy matching, so "y", "Y", "yes", "YES", and "Yes" all count as confirmations. If the input is not recognized, it will ask again. The function does not return until it gets a valid response from the user. Typically, you should use fmt to print out a question before calling askForConfirmation. E.g. fmt.Println("WARNING: Are you sure? (yes/no)")
func CamelCase ¶
camelCase converts a _ delimited string to camel case e.g. very_important_person => VeryImportantPerson
func CamelString ¶
func FormatSourceCode ¶
func FormatSourceCode(filename string)
formatSourceCode formats source files
func GetFileModTime ¶
GetFileModTime returns unix timestamp of `os.File.ModTime` for the given path.
func GetGoVersionSkipMinor ¶
func GetGoVersionSkipMinor() string
func GetradicalWorkPath ¶
func GetradicalWorkPath() string
func Go ¶
Go is a basic promise implementation: it wraps calls a function in a goroutine and returns a channel which will later return the function's return value.
func IsGOMODULE ¶
func IsGOMODULE() bool
func IsInGOPATH ¶
IsInGOPATH checks whether the path is inside of any GOPATH or not
func IsradiantProject ¶
IsradiantProject checks whether the current path is a radiant application or not
func MacOSVersionSupport ¶
func MacOSVersionSupport() bool
func NoticeUpdateradical ¶
func NoticeUpdateradical()
func PrintErrorAndExit ¶
func PrintErrorAndExit(message, errorTemplate string)
func RadicalFuncMap ¶
RadicalFuncMap returns a FuncMap of functions used in different templates.
func SearchGOPATHs ¶
SearchGOPATHs searchs the user GOPATH(s) for the specified application name. It returns a boolean, the application's GOPATH and its full path.
func SplitQuotedFields ¶
SplitQuotedFields is like strings.Fields but ignores spaces inside areas surrounded by single quotes. To specify a single quote use backslash to escape it: '\”
func TmplToString ¶
TmplToString parses a text template and return the result as a string.
func WriteToFile ¶
func WriteToFile(filename, content string)
WriteToFile creates a file and writes content to it