package main
import (
"fmt"
"reflect"
)
type Student struct {
Id string
Name string
Age int
Score float64
}
func main() {
student := Student{
Id: "st01",
Name: "Name 1",
Age: 20,
Score: 5.6,
}
tp := reflect.TypeOf(student)
fmt.Println(tp)
fmt.Println(tp.Name())
}
Output
main.Student
Student