Fixed something wrong.
This commit is contained in:
2
2.2.md
2
2.2.md
@@ -395,7 +395,7 @@ slice有一些简便的操作
|
||||
// map有两个返回值,第二个返回值,如果不存在key,那么ok为false,如果存在ok为true
|
||||
csharpRating, ok := rating["C#"]
|
||||
if ok {
|
||||
fmt.Println("C# is in the map and its rating is ", csharp_rating)
|
||||
fmt.Println("C# is in the map and its rating is ", csharpRating)
|
||||
} else {
|
||||
fmt.Println("We have no rating associated with C# in the map")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user