1、代码
package main
import "fmt"
type person interface {
func1()
}
type sperson struct {
}
func (s *sperson) func1() {
fmt.Println("fun1")
}
func main() {
var p person = &sperson{}
fmt.Printf("%T", p)
}
package main
import "fmt"
type person interface {
func1()
}
type sperson struct {
}
func (s *sperson) func1() {
fmt.Println("fun1")
}
func main() {
var p person = &sperson{}
fmt.Printf("%T", p)
}