Documentation
¶
Index ¶
- func AppConfigDirOrDefault(defaultAppConfigDir string, toolName string) string
- func CreateFileWithSafe(filename string, appendToFile bool, overwrite bool) (*os.File, error)
- func ExtractPhoneDigits(input string) string
- func FileExists(filename string) bool
- func GetEnvOrDefault[T EnvType](key string, defaultValue T) T
- func HasStdin() bool
- func IsAndroid() bool
- func IsFreeBSD() bool
- func IsIOS() bool
- func IsJS() bool
- func IsLinux() bool
- func IsOSX() bool
- func IsOpenBSD() bool
- func IsSolaris() bool
- func IsWindows() bool
- func ParseTargets(targets string, stdin bool) (io.Reader, error)
- func PickRandom[T any](v []T, sourceName string, needsKey bool) T
- func UserConfigDirOrDefault(defaultConfigDir string) string
- type EnvType
- type OsType
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AppConfigDirOrDefault ¶
AppConfigDirOrDefault returns the app config directory
func CreateFileWithSafe ¶ added in v1.0.0
func ExtractPhoneDigits ¶ added in v1.3.2
ExtractPhoneDigits strips all non-digit characters from a phone number string, preserving the original digit order. This normalizes inputs like:
"+1 (555) 234 10 96" → "15552341096" "+998-50-123-45-67" → "998501234567" "15551234567" → "15551234567"
func FileExists ¶
FileExists checks if the file exists in the provided path
func GetEnvOrDefault ¶
GetEnvOrDefault returns the value of the environment variable or the default value if the variable is not set. in requested type.
func HasStdin ¶ added in v1.0.4
func HasStdin() bool
HasStdin determines if the user has piped input
func PickRandom ¶ added in v1.0.0
func UserConfigDirOrDefault ¶
UserConfigDirOrDefault returns the user config directory or defaultConfigDir in case of error
Types ¶
Click to show internal directories.
Click to hide internal directories.