Interface Kind Variable

As reading through reflect package, I noticed that it defined an interface kind.

reflect.Interface

I am wondering what kind of variable will return the Interface kind? I tried the following codes, but all I got is the data type that implementes the interface.

package main

import (
	"fmt"
	"reflect"
)

type People interface {
	change_name()
}

type Person struct {
	name string
	age int
}

func main() {
	var a People = Person{"456", 38}
	fmt.Println(reflect.TypeOf(a).Kind())
 }

func (p Person) change_name() {
	p.name = "123"
}

// output: struct

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.