Documentation
¶
Overview ¶
Package makecopy defines an analyzer that detects make+copy patterns that can be replaced with slices.Clone.
Analyzer makecopy ¶
makecopy: detect make+copy that can be simplified to slices.Clone
This analyzer flags two-statement patterns where a slice is allocated with make and immediately populated with copy:
dst := make([]T, len(src)) copy(dst, src)
These can be replaced with the simpler:
dst := slices.Clone(src)
Available since Go 1.21.
Index ¶
Constants ¶
This section is empty.
Variables ¶
Functions ¶
This section is empty.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.