golang/go

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

Open

#73.830 geöffnet am 22. Mai 2025

Auf GitHub ansehen
 (16 Kommentare) (2 Reaktionen) (0 zugewiesene Personen)Go (19.008 Forks)batch import
AnalysisFeatureRequestToolsgoplsgopls/analysishelp wanted

Repository-Metriken

Stars
 (133.883 Stars)
PR-Merge-Metriken
 (Keine gemergten PRs in 30 T)

Beschreibung

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.

Contributor Guide