Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
steps:
- uses: actions/setup-go@v5
with:
go-version: 1.18
go-version: 1.21
- uses: actions/checkout@v4
- run: make build
- uses: actions/upload-artifact@v4
Expand All @@ -36,7 +36,7 @@ jobs:
steps:
- uses: actions/setup-go@v5
with:
go-version: 1.18
go-version: 1.21
- uses: actions/checkout@v4
- env:
VIMEO_TEST_API_KEY: ${{ secrets.VIMEO_ACCESS_TOKEN }}
Expand All @@ -51,9 +51,9 @@ jobs:
steps:
- uses: actions/setup-go@v5
- uses: actions/checkout@v4
- uses: golangci/golangci-lint-action@v6
- uses: golangci/golangci-lint-action@v8
with:
version: v1.57.2
version: v2.2.2

- name: Go mod
env:
Expand Down
23 changes: 7 additions & 16 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -1,29 +1,20 @@
version: "2"

run:
timeout: 3m

linters:
enable:
- structcheck
- varcheck
- staticcheck
- unconvert
- gofmt
- goimports
- golint
- revive # replacement for golint
- ineffassign
- vet
- govet
- unused
- misspell
- bodyclose
- interfacer
- unconvert
- maligned
# - depguard
- nakedret
- prealloc
- whitespace
disable:
- errcheck

run:
deadline: 3m
skip-dirs:
- bin
- docs
8 changes: 4 additions & 4 deletions pkg/builder/youtube.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
return "key", string(key)
}

type YouTubeBuilder struct {

Check failure on line 35 in pkg/builder/youtube.go

View workflow job for this annotation

GitHub Actions / Checks

exported: exported type YouTubeBuilder should have comment or be unexported (revive)
client *youtube.Service
key apiKey
}
Expand Down Expand Up @@ -148,21 +148,21 @@
return snippet.Default.Url
}

func (yt *YouTubeBuilder) GetVideoCount(ctx context.Context, info *model.Info) (uint64, error) {

Check failure on line 151 in pkg/builder/youtube.go

View workflow job for this annotation

GitHub Actions / Checks

exported: exported method YouTubeBuilder.GetVideoCount should have comment or be unexported (revive)
switch info.LinkType {
case model.TypeChannel, model.TypeUser:
// Cost: 3 units
if channel, err := yt.listChannels(ctx, info.LinkType, info.ItemID, "id,statistics"); err != nil {
return 0, err
} else { // nolint:golint
} else { // nolint:revive
return channel.Statistics.VideoCount, nil
}

case model.TypePlaylist:
// Cost: 3 units
if playlist, err := yt.listPlaylists(ctx, info.ItemID, "", "id,contentDetails"); err != nil {
return 0, err
} else { // nolint:golint
} else { // nolint:revive
return uint64(playlist.ContentDetails.ItemCount), nil
}

Expand Down Expand Up @@ -199,7 +199,7 @@

if date, err := yt.parseDate(channel.Snippet.PublishedAt); err != nil {
return err
} else { // nolint:golint
} else { // nolint:revive
feed.PubDate = date
}

Expand All @@ -222,7 +222,7 @@

if date, err := yt.parseDate(playlist.Snippet.PublishedAt); err != nil {
return err
} else { // nolint:golint
} else { // nolint:revive
feed.PubDate = date
}

Expand Down Expand Up @@ -409,7 +409,7 @@
return nil
}

func (yt *YouTubeBuilder) Build(ctx context.Context, cfg *feed.Config) (*model.Feed, error) {

Check failure on line 412 in pkg/builder/youtube.go

View workflow job for this annotation

GitHub Actions / Checks

exported: exported method YouTubeBuilder.Build should have comment or be unexported (revive)
info, err := ParseURL(cfg.URL)
if err != nil {
return nil, err
Expand Down Expand Up @@ -456,7 +456,7 @@
return _feed, nil
}

func NewYouTubeBuilder(key string) (*YouTubeBuilder, error) {

Check failure on line 459 in pkg/builder/youtube.go

View workflow job for this annotation

GitHub Actions / Checks

exported: exported function NewYouTubeBuilder should have comment or be unexported (revive)
if key == "" {
return nil, errors.New("empty YouTube API key")
}
Expand Down
Loading