Update and fix linters

This commit is contained in:
Maksym Pavlenko
2019-10-26 23:01:09 -07:00
parent 08a58e6a1b
commit 7168f6e8df
2 changed files with 20 additions and 15 deletions
+16 -11
View File
@@ -1,15 +1,20 @@
linters:
presets:
- bugs
enable:
- structcheck
- varcheck
- staticcheck
- unconvert
- gofmt
- goimports
- golint
- ineffassign
- vet
- unused
- format
- style
- complexity
- performance
- misspell
disable:
- errcheck
- gochecknoglobals
- lll
issues:
exclude:
- if block ends with a return statement, so drop this else and outdent its block
run:
skip-dirs:
- bin
- docs
+4 -4
View File
@@ -146,7 +146,7 @@ func (yt *YouTubeBuilder) GetVideoCount(feed *model.Feed) (uint64, error) {
// Cost: 3 units
if channel, err := yt.listChannels(feed.LinkType, feed.ItemID, "id,statistics"); err != nil {
return 0, err
} else {
} else { // nolint:golint
return channel.Statistics.VideoCount, nil
}
@@ -154,7 +154,7 @@ func (yt *YouTubeBuilder) GetVideoCount(feed *model.Feed) (uint64, error) {
// Cost: 3 units
if playlist, err := yt.listPlaylists(feed.ItemID, "", "id,contentDetails"); err != nil {
return 0, err
} else {
} else { // nolint:golint
return uint64(playlist.ContentDetails.ItemCount), nil
}
@@ -197,7 +197,7 @@ func (yt *YouTubeBuilder) queryFeed(feed *model.Feed) (string, error) {
if date, err := yt.parseDate(channel.Snippet.PublishedAt); err != nil {
return "", err
} else {
} else { // nolint:golint
pubDate = date
}
@@ -221,7 +221,7 @@ func (yt *YouTubeBuilder) queryFeed(feed *model.Feed) (string, error) {
if date, err := yt.parseDate(playlist.Snippet.PublishedAt); err != nil {
return "", err
} else {
} else { // nolint:golint
pubDate = date
}