package main

import "fmt"

type animal interface {
	Eat()
}

type cat struct {
}

func (c cat) Eat() {
	fmt.Println("Cat like to eat fish!")
}

var _ animal = (*cat)(nil)

func main() {
	fmt.Println("test static compile")
}

  

相关文章:

  • 2022-02-21
  • 2021-06-10
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-05-29
  • 2021-11-26
  • 2021-11-09
猜你喜欢
  • 2022-12-23
  • 2021-10-08
  • 2022-12-23
  • 2021-07-25
  • 2021-08-22
  • 2021-12-05
  • 2021-11-22
相关资源
相似解决方案