Last active
April 13, 2016 12:37
-
-
Save sumitramteke/78c1921986d46159c6608e872c5d0b32 to your computer and use it in GitHub Desktop.
Check type of user defined struct : http://play.golang.org/p/o9lcyqkzcW
This file contains hidden or 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
package main | |
import ( | |
"fmt" | |
"reflect" | |
) | |
type Users struct { | |
ID string | |
FirstName string | |
LastName string | |
Username string | |
Contact string | |
SecondaryContact string | |
Email string | |
} | |
func main() { | |
t := Users{} | |
fmt.Printf("Type's name is: %#v\n", reflect.TypeOf(t).Name()) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment