Keep variable name consistency
This commit is contained in:
@@ -142,7 +142,7 @@ interface类型定义了一组方法,如果某个对象实现了某个接口
|
||||
mike := Student{Human{"Mike", 25, "222-222-XXX"}, "MIT", 0.00}
|
||||
paul := Student{Human{"Paul", 26, "111-222-XXX"}, "Harvard", 100}
|
||||
sam := Employee{Human{"Sam", 36, "444-222-XXX"}, "Golang Inc.", 1000}
|
||||
Tom := Employee{Human{"Tom", 37, "222-444-XXX"}, "Things Ltd.", 5000}
|
||||
tom := Employee{Human{"Tom", 37, "222-444-XXX"}, "Things Ltd.", 5000}
|
||||
|
||||
//定义Men类型的变量i
|
||||
var i Men
|
||||
@@ -154,8 +154,8 @@ interface类型定义了一组方法,如果某个对象实现了某个接口
|
||||
i.Sing("November rain")
|
||||
|
||||
//i也能存储Employee
|
||||
i = Tom
|
||||
fmt.Println("This is Tom, an Employee:")
|
||||
i = tom
|
||||
fmt.Println("This is tom, an Employee:")
|
||||
i.SayHi()
|
||||
i.Sing("Born to be wild")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user