Reflection / Primitive types / Essential Go

Run Settings
LanguageGo
Language Version
Run Command
package main import ( "fmt" "reflect" ) func getIntValue(v interface{}) { var reflectValue = reflect.ValueOf(v) n := reflectValue.Int() fmt.Printf("Int value is: %d\n", n) } func main() { getIntValue(3) getIntValue(int8(4)) getIntValue("") }
Editor Settings
Theme
Key bindings
Full width
Lines