golang/go

x/tools/gopls/internal/analysis: analyzer for slice aliasing mistakes

Open

#73.830 aperta il 22 mag 2025

Vedi su GitHub
 (16 commenti) (2 reazioni) (0 assegnatari)Go (19.008 fork)batch import
AnalysisFeatureRequestToolsgoplsgopls/analysishelp wanted

Metriche repository

Star
 (133.883 star)
Metriche merge PR
 (Nessuna PR mergiata in 30 g)

Descrizione

In a discussion about slice aliasing bugs, @randall77 suggested an analyzer that detects "aliasing of two slice variables, where the capacity of the slice is unknown (due to append starting from nil, say), and then an append on each of the aliased slices". We should prototype a simple analyzer to detect this pattern and see what turns up.

Guida contributor