Skip to content

Instantly share code, notes, and snippets.

@sumitramteke
Last active April 13, 2016 12:37
Show Gist options
  • Save sumitramteke/78c1921986d46159c6608e872c5d0b32 to your computer and use it in GitHub Desktop.
Save sumitramteke/78c1921986d46159c6608e872c5d0b32 to your computer and use it in GitHub Desktop.
Check type of user defined struct : http://play.golang.org/p/o9lcyqkzcW
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