Standard library / reflect
reflect.Value.CanInt()
Report whether Int may be called without panic. Expected stdout: 'true\n'.
Formal Syntax & Structure
go syntaxgo
func (v Value) CanInt() boolReturn Value
bool
Report whether Int may be called without panic.
Working Example
Example Snippetgo
package main
import ( "fmt" "reflect")
func main() { fmt.Println(reflect.ValueOf(int8(1)).CanInt()) }