package main
import "fmt"
type englishScoreType int
type mathScoreType int
func (e englishScoreType) isPassed() bool {
return e >= 80
}
func (m mathScoreType) isPassed() bool {
return m >= 70
}
type passChecker interface {
isPassed() bool
}
func showResult(score passChecker) {
if score.isPassed() {
fmt.Println("Pass!")
} else {
fmt.Println("Fail...")
}
}
func main() {
englishScore := englishScoreType(90)
mathScore := mathScoreType(50)
showResult(englishScore)
showResult(mathScore)
}
