We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 05546b4 commit fa2d0e2Copy full SHA for fa2d0e2
if_expression_test.go
@@ -17,10 +17,13 @@ func ExampleReturn() {
17
// 是
18
}
19
20
-func TestMap(t *testing.T) {
21
- m := map[string]interface{}{
22
- "foo": "bar",
23
- }
24
- //t.Log(m["bad"]) // nil
25
- t.Log(Return(m["bad"] != nil, m["bad"], "aaa")) // ⚠️ 范型传nil进来就panic了.
26
-}
+//func TestMap(t *testing.T) {
+// m := map[string]interface{}{
+// "foo": "bar",
+// }
+// m["bar"] = "aaa"
+// //t.Log(m["bad"]) // nil
+// var v string
27
+// v = Return[string](m["bad"] == nil, m["bar"], "aaa") // m["bar"]的类型不对
28
+// t.Log(v)
29
+//}
0 commit comments