Keep variable name consistency
This commit is contained in:
@@ -138,7 +138,7 @@ Like the above example, if we define a variable "m" as interface Men, then any o
|
|||||||
mike := Student{Human{"Mike", 25, "222-222-XXX"}, "MIT", 0.00}
|
mike := Student{Human{"Mike", 25, "222-222-XXX"}, "MIT", 0.00}
|
||||||
paul := Student{Human{"Paul", 26, "111-222-XXX"}, "Harvard", 100}
|
paul := Student{Human{"Paul", 26, "111-222-XXX"}, "Harvard", 100}
|
||||||
sam := Employee{Human{"Sam", 36, "444-222-XXX"}, "Golang Inc.", 1000}
|
sam := Employee{Human{"Sam", 36, "444-222-XXX"}, "Golang Inc.", 1000}
|
||||||
Tom := Employee{Human{"Sam", 36, "444-222-XXX"}, "Things Ltd.", 5000}
|
tom := Employee{Human{"Sam", 36, "444-222-XXX"}, "Things Ltd.", 5000}
|
||||||
|
|
||||||
// define interface i
|
// define interface i
|
||||||
var i Men
|
var i Men
|
||||||
@@ -150,7 +150,7 @@ Like the above example, if we define a variable "m" as interface Men, then any o
|
|||||||
i.Sing("November rain")
|
i.Sing("November rain")
|
||||||
|
|
||||||
//i can store Employee
|
//i can store Employee
|
||||||
i = Tom
|
i = tom
|
||||||
fmt.Println("This is Tom, an Employee:")
|
fmt.Println("This is Tom, an Employee:")
|
||||||
i.SayHi()
|
i.SayHi()
|
||||||
i.Sing("Born to be wild")
|
i.Sing("Born to be wild")
|
||||||
|
|||||||
Reference in New Issue
Block a user