mirror of
https://github.com/nspcc-dev/neo-go.git
synced 2024-12-23 13:41:37 +00:00
6b21ad9922
Everywhere including examples, external interop APIs, bindings generators code and in other valuable places. A couple of `interface{}` usages are intentionally left in the CHANGELOG.md, documentation and tests.
22 lines
484 B
Go
22 lines
484 B
Go
// Package convert provides functions for type conversion.
|
|
package convert
|
|
|
|
// ToInteger converts it's argument to an Integer.
|
|
func ToInteger(v any) int {
|
|
return v.(int)
|
|
}
|
|
|
|
// ToBytes converts it's argument to a Buffer VM type.
|
|
func ToBytes(v any) []byte {
|
|
return v.([]byte)
|
|
}
|
|
|
|
// ToString converts it's argument to a ByteString VM type.
|
|
func ToString(v any) string {
|
|
return v.(string)
|
|
}
|
|
|
|
// ToBool converts it's argument to a Boolean.
|
|
func ToBool(v any) bool {
|
|
return v.(bool)
|
|
}
|