mirror of
https://github.com/golang/go.git
synced 2025-05-06 08:03:03 +00:00
Updated CodeReviewComments (markdown)
parent
2ae2832309
commit
e3ee7b02ab
@ -53,7 +53,7 @@ and so on.
|
|||||||
|
|
||||||
## Declaring Empty Slices
|
## Declaring Empty Slices
|
||||||
|
|
||||||
For a slice of strings, for example, prefer
|
When declaring a slice, prefer
|
||||||
```go
|
```go
|
||||||
var t []string
|
var t []string
|
||||||
```
|
```
|
||||||
@ -62,7 +62,7 @@ to
|
|||||||
t := []string{}
|
t := []string{}
|
||||||
```
|
```
|
||||||
|
|
||||||
The former avoids allocating memory if the string is never appended to.
|
The former avoids allocating memory if the slice is never appended to.
|
||||||
|
|
||||||
## Doc Comments
|
## Doc Comments
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user