mirror of
https://github.com/mudler/luet.git
synced 2025-09-01 23:37:07 +00:00
Update vendor
This commit is contained in:
27
vendor/github.com/jedib0t/go-pretty/table/util.go
generated
vendored
Normal file
27
vendor/github.com/jedib0t/go-pretty/table/util.go
generated
vendored
Normal file
@@ -0,0 +1,27 @@
|
||||
package table
|
||||
|
||||
import "reflect"
|
||||
|
||||
// AutoIndexColumnID returns a unique Column ID/Name for the given Column Number.
|
||||
// The functionality is similar to what you get in an Excel spreadsheet w.r.t.
|
||||
// the Column ID/Name.
|
||||
func AutoIndexColumnID(colIdx int) string {
|
||||
charIdx := colIdx % 26
|
||||
out := string(65 + charIdx)
|
||||
colIdx = colIdx / 26
|
||||
if colIdx > 0 {
|
||||
return AutoIndexColumnID(colIdx-1) + out
|
||||
}
|
||||
return out
|
||||
}
|
||||
|
||||
// isNumber returns true if the argument is a numeric type; false otherwise.
|
||||
func isNumber(x interface{}) bool {
|
||||
switch reflect.TypeOf(x).Kind() {
|
||||
case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64,
|
||||
reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64,
|
||||
reflect.Float32, reflect.Float64:
|
||||
return true
|
||||
}
|
||||
return false
|
||||
}
|
Reference in New Issue
Block a user