Skip to content

Commit

Permalink
Merge pull request #2 from Quasilyte/master
Browse files Browse the repository at this point in the history
👷 Fix issues found by go-critic linter
  • Loading branch information
mamal72 committed Jun 30, 2018
2 parents 6121551 + 6a33d51 commit e037d23
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions golyrics.go
Expand Up @@ -44,7 +44,7 @@ func breakToNewLine(HTML string) string {
}

func stripeHTMLTags(HTML string) string {
regex, _ := regexp.Compile("<[^>]+>")
regex := regexp.MustCompile("<[^>]+>")
return regex.ReplaceAllString(HTML, "")
}

Expand Down Expand Up @@ -78,7 +78,7 @@ func SearchTrack(query string) ([]Track, error) {

suggestions := []Track{}
jsonparser.ArrayEach(data, func(value []byte, _ jsonparser.ValueType, offset int, _ error) {
title := string(value[:])
title := string(value)
trackParts := strings.SplitN(title, ":", 2)
if len(trackParts) < 2 {
return
Expand All @@ -95,6 +95,6 @@ func SearchTrack(query string) ([]Track, error) {

// SearchTrackByArtistAndName searches for tracks
// using artist and name of the track.
func SearchTrackByArtistAndName(artist string, name string) ([]Track, error) {
func SearchTrackByArtistAndName(artist, name string) ([]Track, error) {
return SearchTrack(artist + ":" + name)
}
2 changes: 1 addition & 1 deletion golyrics_test.go
Expand Up @@ -247,7 +247,7 @@ func TestTrack_FetchLyrics(t *testing.T) {
fields: fields{
Artist: "Sandra_Boynton",
Name: "The_Shortest_Song_In_The_Universe",
Lyrics: "The shortest song in the universe\nReally isn't much fun\nIt only has one puny verse\n. . . and then it's done!\n",
Lyrics: "The shortest song in the universe\nReally isn't much fun\nIt only has one puny verse\n... And then it's done!\n",
},
},
}
Expand Down

0 comments on commit e037d23

Please sign in to comment.