Make checking map key exists optional

This commit is contained in:
Ginger Bill
2017-02-06 21:31:27 +00:00
parent f11d73ffaa
commit df78b8ad3e
4 changed files with 25 additions and 12 deletions

View File

@@ -18,14 +18,14 @@ main :: proc() {
m["a"] = 56;
m["b"] = 13453;
m["c"] = 7654;
c, ok := m["c"];
c := m["c"];
_, ok := m["c"];
assert(ok && c == 7654);
for val, key in m {
fmt.printf("m[\"%s\"] == %v\n", key, val);
}
// fm: map[128, int]f32;
/*