1
0
mirror of https://github.com/MADTeacher/go_basics.git synced 2025-11-23 21:34:47 +02:00
Files
go_basics/part_3/3.9/5.go
2025-06-04 18:38:52 +03:00

24 lines
321 B
Go

package main
import "fmt"
type shape struct{}
type car struct{}
func checkType(i interface{}) {
switch i.(type) {
case shape:
fmt.Println("It is shape")
case car:
fmt.Println("It is car")
default:
fmt.Println("What is this pokemon?")
}
}
func main() {
checkType(shape{})
checkType(car{})
checkType(6)
}