Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/container-capacity.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ map, even up to the specified capacity.
<tr><td>

```go
m := make(map[string]os.FileInfo)

files, _ := os.ReadDir("./files")

m := make(map[string]os.DirEntry)
for _, f := range files {
m[f.Name()] = f
}
Expand All @@ -51,8 +51,8 @@ for _, f := range files {
</td></tr>
<tr><td>

`m` is created without a size hint; there may be more
allocations at assignment time.
`m` is created without a size hint; the map will resize
dynamically, causing multiple allocations as it grows.

</td><td>

Expand Down
8 changes: 4 additions & 4 deletions style.md
Original file line number Diff line number Diff line change
Expand Up @@ -2259,9 +2259,9 @@ map, even up to the specified capacity.
<tr><td>

```go
m := make(map[string]os.FileInfo)

files, _ := os.ReadDir("./files")

m := make(map[string]os.DirEntry)
for _, f := range files {
m[f.Name()] = f
}
Expand All @@ -2282,8 +2282,8 @@ for _, f := range files {
</td></tr>
<tr><td>

`m` is created without a size hint; there may be more
allocations at assignment time.
`m` is created without a size hint; the map will resize
dynamically, causing multiple allocations as it grows.

</td><td>

Expand Down