MCPcopy Create free account
hub / github.com/devfeel/mapper / ToInt64

Function ToInt64

convert.go:174–185  ·  view source on GitHub ↗

ToInt64 interface to int64

(value interface{})

Source from the content-addressed store, hash-verified

172
173// ToInt64 interface to int64
174func ToInt64(value interface{}) (d int64) {
175 val := reflect.ValueOf(value)
176 switch value.(type) {
177 case int, int8, int16, int32, int64:
178 d = val.Int()
179 case uint, uint8, uint16, uint32, uint64:
180 d = int64(val.Uint())
181 default:
182 panic(fmt.Errorf("ToInt64 needs numeric type, not `%T`", value))
183 }
184 return
185}
186
187type argInt []int
188

Callers

nothing calls this directly

Calls 2

IntMethod · 0.80
UintMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…