Skip to content

Commit

Permalink
mini spec: builtin delete
Browse files Browse the repository at this point in the history
  • Loading branch information
xushiwei committed Sep 12, 2024
1 parent e034dc2 commit 9662f16
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions doc/spec-mini.md
Original file line number Diff line number Diff line change
Expand Up @@ -1503,4 +1503,15 @@ _ = imag(3 << s) // illegal: 3 assumes complex type, cannot sh

### Deletion of map elements

The built-in function `delete` removes the element with key `k` from a [map](#map-types) `m`. The value `k` must be [assignable]() to the key type of `m`.

```go
delete(m, k) // remove element m[k] from map m
```

If the map m is nil or the element m[k] does not exist, delete is a no-op.

### Length and capacity¶

TODO

0 comments on commit 9662f16

Please sign in to comment.