Answers for "convert empty interface to int64"

Go
1

golang convert interface to concrete type

type Person struct {
	firstName string
	lastName  string
}
func printIfPerson(object interface{}) {
	person, ok := object.(Person)
	if ok {
		fmt.Printf("Hello %s!n", person.firstName)
	}
}
Posted by: Guest on May-26-2020

Code answers related to "convert empty interface to int64"

Browse Popular Code Answers by Language