Skip to content

Commit

Permalink
Fix header for string-byte-slice (#202)
Browse files Browse the repository at this point in the history
Clarify that the intent for string-to-byte conversions is to avoid repeated conversions.

---------

Co-authored-by: alex-semenyuk <[email protected]>
Co-authored-by: Matt Way <[email protected]>
  • Loading branch information
3 people authored Nov 28, 2023
1 parent 55fc8cf commit 09114fa
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
- [No goroutines in `init()`](goroutine-init.md)
- [Performance](performance.md)
- [Prefer strconv over fmt](strconv.md)
- [Avoid string-to-byte conversion](string-byte-slice.md)
- [Avoid repeated string-to-byte conversions](string-byte-slice.md)
- [Prefer Specifying Container Capacity](container-capacity.md)
- Style
- [Avoid overly long lines](line-length.md)
Expand Down
2 changes: 1 addition & 1 deletion src/string-byte-slice.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Avoid string-to-byte conversion
# Avoid repeated string-to-byte conversions

Do not create byte slices from a fixed string repeatedly. Instead, perform the
conversion once and capture the result.
Expand Down
4 changes: 2 additions & 2 deletions style.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
- [No goroutines in `init()`](#no-goroutines-in-init)
- [Performance](#performance)
- [Prefer strconv over fmt](#prefer-strconv-over-fmt)
- [Avoid string-to-byte conversion](#avoid-string-to-byte-conversion)
- [Avoid repeated string-to-byte conversions](#avoid-repeated-string-to-byte-conversions)
- [Prefer Specifying Container Capacity](#prefer-specifying-container-capacity)
- [Style](#style)
- [Avoid overly long lines](#avoid-overly-long-lines)
Expand Down Expand Up @@ -2192,7 +2192,7 @@ BenchmarkStrconv-4 64.2 ns/op 1 allocs/op
</td></tr>
</tbody></table>
### Avoid string-to-byte conversion
### Avoid repeated string-to-byte conversions
Do not create byte slices from a fixed string repeatedly. Instead, perform the
conversion once and capture the result.
Expand Down

0 comments on commit 09114fa

Please sign in to comment.