Essential Go / Reflection

Run Settings
LanguageGo
Language Version
Run Command
package main import ( "fmt" "reflect" ) func main() { var v interface{} = 4 var reflectVal reflect.Value = reflect.ValueOf(v) var typ reflect.Type = reflectVal.Type() fmt.Printf("Type '%s' of size: %d bytes\n", typ.Name(), typ.Size()) if typ.Kind() == reflect.Int { fmt.Printf("v contains value of type int\n") } }
Editor Settings
Theme
Key bindings
Full width
Lines