Documentation
¶
Index ¶
- func CanConvert(data interface{}, optionType types.OptionType) (bool, error)
- func ConvertString(value string, data any, arg string, delimiterFunc types.ListDelimiterFunc) error
- func GetSecureString(prompt string, w io.Writer, terminal TerminalReader) (string, error)
- func InsertSlice[T any](arr []T, pos int, element ...T) []T
- func Min[T Numeric](x, y T) T
- func NewOfType[T any](value T) *T
- func Reverse[T any](s []T)
- func UnwrapType(t reflect.Type) reflect.Type
- func UnwrapValue(v reflect.Value) (reflect.Value, error)
- type DefaultTerminal
- type Number
- type Numeric
- type TerminalReader
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CanConvert ¶
func CanConvert(data interface{}, optionType types.OptionType) (bool, error)
func ConvertString ¶
func GetSecureString ¶
GetSecureString reads a password from the terminal
func InsertSlice ¶
InsertSlice inserts item(s) T at position pos and returns a slice
func UnwrapType ¶
UnwrapType recursively unwraps pointer.go types and returns the underlying type
Types ¶
type DefaultTerminal ¶
type DefaultTerminal struct{}
DefaultTerminal implements real terminal operations
func (*DefaultTerminal) IsTerminal ¶
func (t *DefaultTerminal) IsTerminal(fd int) bool
IsTerminal checks if we are attached to a real terminal
func (*DefaultTerminal) ReadPassword ¶
func (t *DefaultTerminal) ReadPassword(fd int) ([]byte, error)
ReadPassword reads a password from the terminal
type Number ¶
type Number struct {
Int int64
Float float64
Complex complex128
IsInt bool
IsFloat bool
IsComplex bool
IsNegative bool
}
func ParseNumeric ¶
Click to show internal directories.
Click to hide internal directories.