Skip to content

Instantly share code, notes, and snippets.

@kitz99
Last active March 20, 2019 10:51
Show Gist options
  • Save kitz99/486884cea2418668c9ddab5497d64bf9 to your computer and use it in GitHub Desktop.
Save kitz99/486884cea2418668c9ddab5497d64bf9 to your computer and use it in GitHub Desktop.
import (
"fmt"
"reflect"
)
type Rectangle struct {
Width int
Height int
}
func main() {
r := Rectangle{Width: 5, Height: 10}
rType := reflect.TypeOf(r)
rKind := rType.Kind()
rValue := reflect.ValueOf(r)
fmt.Println(rType)
fmt.Println(rKind)
fmt.Println(rValue)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment