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 = "vikalanbo"
Variables ¶
This section is empty.
Functions ¶
func CheckGitConfig ¶
func ExecuteCmd ¶
ExecuteCmd provides a shorthand way to run a shell command
func GetRootDir ¶
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 ¶
GoModReplace runs "go mod edit -replace" in the selected replace_payload e.g: github.com/gocql/gocql=github.com/scylladb/[email protected]
func NonInteractiveCommand ¶
NonInteractiveCommand creates the command string from a flagSet to be used for getting the equivalent non-interactive shell command
func ValidateModuleName ¶
ValidateModuleName returns true if it's a valid module name. It allows any number of / and . characters in between.
Types ¶
This section is empty.