Last active
March 20, 2019 10:51
-
-
Save kitz99/486884cea2418668c9ddab5497d64bf9 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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