Skip to content

Commit 93d83f9

Browse files
refactor: replace empty slice literal with var declaration
This PR streamlines slice declarations by replacing an empty slice literal with a var declaration. The change removes unnecessary allocation and embraces Go’s idiomatic use of nil slices for empty collections. - Empty slice literal used to declare a variable: The code originally declared an empty slice with [][]string{}, which allocates a zero-length slice. By switching to `var extras [][]string`, we declare a nil slice that behaves identically in append scenarios but avoids an extra allocation and better communicates intent. > This Autofix was generated by AI. Please review the change before merging.
1 parent da43d0b commit 93d83f9

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

internal/ui.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ func displaySignalResult(result *tmhi.SignalResult) {
3737
}
3838

3939
if result.FiveG != nil {
40-
extras := [][]string{}
40+
var extras [][]string
4141
if result.FiveG.AntennaUsed != "" {
4242
extras = append(extras, []string{"Antenna", result.FiveG.AntennaUsed})
4343
}

0 commit comments

Comments
 (0)