package main
import "fmt"
type englishScoreType int
type mathScoreType int
func showResult(score any) {
if v, ok := score.(englishScoreType); ok {
if v >= 80 {
fmt.Println("Pass!")
} else {
fmt.Println("Fail...")
}
}
if v, ok := score.(mathScoreType); ok {
if v >= 80 {
fmt.Println("Pass!")
} else {
fmt.Println("Fail...")
}
}
fmt.Println("Invalid score!")
}
func main() {
englishScore := englishScoreType(90)
mathScore := mathScoreType(50)
showResult(englishScore)
showResult(mathScore)
}