Add exportloopref linter
This commit is contained in:
parent
16865f0fca
commit
7b0a8f47de
2 changed files with 3 additions and 1 deletions
|
|
@ -7,6 +7,7 @@ linters:
|
||||||
- depguard
|
- depguard
|
||||||
- dogsled
|
- dogsled
|
||||||
- errcheck
|
- errcheck
|
||||||
|
- exportloopref
|
||||||
- gocyclo
|
- gocyclo
|
||||||
- goprintffuncname
|
- goprintffuncname
|
||||||
- gosec
|
- gosec
|
||||||
|
|
|
||||||
|
|
@ -109,6 +109,7 @@ func (c *SearchingController) Search2(w http.ResponseWriter, r *http.Request) (*
|
||||||
searchResult2 := &responses.SearchResult2{}
|
searchResult2 := &responses.SearchResult2{}
|
||||||
searchResult2.Artist = make([]responses.Artist, len(as))
|
searchResult2.Artist = make([]responses.Artist, len(as))
|
||||||
for i, artist := range as {
|
for i, artist := range as {
|
||||||
|
artist := artist
|
||||||
searchResult2.Artist[i] = responses.Artist{
|
searchResult2.Artist[i] = responses.Artist{
|
||||||
Id: artist.ID,
|
Id: artist.ID,
|
||||||
Name: artist.Name,
|
Name: artist.Name,
|
||||||
|
|
@ -116,7 +117,7 @@ func (c *SearchingController) Search2(w http.ResponseWriter, r *http.Request) (*
|
||||||
UserRating: artist.Rating,
|
UserRating: artist.Rating,
|
||||||
}
|
}
|
||||||
if artist.Starred {
|
if artist.Starred {
|
||||||
searchResult2.Artist[i].Starred = &artist.StarredAt
|
searchResult2.Artist[i].Starred = &as[i].StarredAt
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
searchResult2.Album = childrenFromAlbums(r.Context(), als)
|
searchResult2.Album = childrenFromAlbums(r.Context(), als)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue