Documentation
¶
Overview ¶
Package utils provides extra utility for the program
Index ¶
- Constants
- func CheckGitConfig(key string) (bool, error)
- func ExecuteCmd(name string, args []string, dir string) error
- func GetRootDir(moduleName string) string
- func GoFmt(appDir string) error
- func GoGetPackage(appDir string, packages []string) error
- func GoModReplace(appDir string, replace string) error
- func GoTidy(appDir string) error
- func InitGoMod(projectName string, appDir string) error
- func NonInteractiveCommand(use string, flagSet *pflag.FlagSet) string
- func RegisterStaticCompletions(cmd *cobra.Command, flag string, options []string)
- func ValidateModuleName(moduleName string) bool
Constants ¶
const ProgramName = "go-blueprint"
Variables ¶
This section is empty.
Functions ¶
func CheckGitConfig ¶ added in v0.5.3
func ExecuteCmd ¶
ExecuteCmd provides a shorthand way to run a shell command
func GetRootDir ¶ added in v0.7.9
GetRootDir returns the project directory name from the module path. Returns the last token by splitting the moduleName with /
func GoGetPackage ¶
GoGetPackage runs "go get" for a given package in the selected directory
func GoModReplace ¶ added in v0.10.0
GoModReplace runs "go mod edit -replace" in the selected replace_payload e.g: github.com/gocql/gocql=github.com/scylladb/gocql@v1.14.4
func NonInteractiveCommand ¶ added in v0.2.9
NonInteractiveCommand creates the command string from a flagSet to be used for getting the equivalent non-interactive shell command
func RegisterStaticCompletions ¶ added in v0.10.9
func ValidateModuleName ¶ added in v0.7.9
ValidateModuleName returns true if it's a valid module name. It allows any number of / and . characters in between.
Types ¶
This section is empty.