Add exportloopref linter

This commit is contained in:
Deluan 2022-09-30 18:23:47 -04:00
parent 16865f0fca
commit 7b0a8f47de
2 changed files with 3 additions and 1 deletions

View File

@ -7,6 +7,7 @@ linters:
- depguard
- dogsled
- errcheck
- exportloopref
- gocyclo
- goprintffuncname
- gosec

View File

@ -109,6 +109,7 @@ func (c *SearchingController) Search2(w http.ResponseWriter, r *http.Request) (*
searchResult2 := &responses.SearchResult2{}
searchResult2.Artist = make([]responses.Artist, len(as))
for i, artist := range as {
artist := artist
searchResult2.Artist[i] = responses.Artist{
Id: artist.ID,
Name: artist.Name,
@ -116,7 +117,7 @@ func (c *SearchingController) Search2(w http.ResponseWriter, r *http.Request) (*
UserRating: artist.Rating,
}
if artist.Starred {
searchResult2.Artist[i].Starred = &artist.StarredAt
searchResult2.Artist[i].Starred = &as[i].StarredAt
}
}
searchResult2.Album = childrenFromAlbums(r.Context(), als)