Empty slice literal used to declare a variable GO-W1027
Anti-pattern
Minor
4 months agoa year old
Empty slice literal of type "[]string" used to define "chars"
 49
 50// AssignedChars returns a list of all the text characters assigned to an operation
 51func (widget *KeyboardWidget) AssignedChars() []string {
 52	chars := []string{} 53
 54	for char := range widget.charMap {
 55		chars = append(chars, char)
Empty slice literal of type "[]string" used to define "keys"
46	tbl.tblWriter.SetColMinWidth(0, colWidth0)
47	tbl.tblWriter.SetColMinWidth(1, colWidth1)
48
49	keys := []string{}50	for key := range dataMap {
51		keys = append(keys, key)
52	}
Empty slice literal of type "[]string" used to define "out"
 33//	b := FindBetween(a, "{", "}")
 34//	> [" cat ", " dog "]
 35func FindBetween(input string, left string, right string) []string {
 36	out := []string{} 37
 38	i := 0
 39	for i >= 0 {
Empty slice literal of type "[]*owm.CurrentWeatherData" used to define "data"
 42// It takes a list of OpenWeatherMap city IDs.
 43// It returns a list of OpenWeatherMap CurrentWeatherData structs, one per valid city code.
 44func (widget *Widget) Fetch(cityIDs []int) []*owm.CurrentWeatherData {
 45	data := []*owm.CurrentWeatherData{} 46
 47	for _, cityID := range cityIDs {
 48		result, err := widget.currentWeather(cityID)
Empty slice literal of type "[]string" used to define "descs"
 55}
 56
 57func (widget *Widget) description(cityData *owm.CurrentWeatherData) string {
 58	descs := []string{} 59	for _, weather := range cityData.Weather {
 60		descs = append(descs, fmt.Sprintf(" %s", weather.Description))
 61	}