package main

import (
	"log"
	"reflect"
	"strings"
)

type User struct {
	Name string
	Age  int
}

func (u *User) GetName() string {
	return u.Name
}

type IName interface {
	GetName() string
}

func getType(object any) reflect.Type {
	return reflect.TypeOf(object)
}

func main() {
	ptrUser := &User{
		Name: "John",
		Age:  32,
	}

	rtype := getType(ptrUser)
	isPointer := strings.HasPrefix(rtype.String(), "*")
	log.Println(rtype, isPointer)
}
