From 57516c738e58af106e94e869d023c5b60c029a0e Mon Sep 17 00:00:00 2001 From: Rob Watson Date: Mon, 13 Dec 2021 21:30:37 +0100 Subject: [PATCH] Add staticcheck to CI steps --- .drone.yml | 2 ++ backend/filestore/fs.go | 2 +- backend/media/service.go | 6 ------ 3 files changed, 3 insertions(+), 7 deletions(-) diff --git a/.drone.yml b/.drone.yml index dd4a997..7033336 100644 --- a/.drone.yml +++ b/.drone.yml @@ -8,6 +8,8 @@ steps: image: golang:1.17 commands: - cd backend/ + - go install honnef.co/go/tools/cmd/staticcheck@latest - go build ./... - go vet ./... + - staticcheck ./... - go test -bench=. -benchmem -cover ./... diff --git a/backend/filestore/fs.go b/backend/filestore/fs.go index ff51720..337988f 100644 --- a/backend/filestore/fs.go +++ b/backend/filestore/fs.go @@ -54,7 +54,7 @@ func (s *FileSystemStore) GetObjectWithRange(ctx context.Context, key string, st if err != nil { return nil, fmt.Errorf("error opening file: %v", err) } - _, err = fptr.Seek(start, os.SEEK_SET) + _, err = fptr.Seek(start, io.SeekStart) if err != nil { return nil, fmt.Errorf("error seeking in file: %v", err) } diff --git a/backend/media/service.go b/backend/media/service.go index 5ccf839..488dbb3 100644 --- a/backend/media/service.go +++ b/backend/media/service.go @@ -20,11 +20,6 @@ import ( "go.uber.org/zap" ) -const ( - getVideoExpiresIn = time.Hour - getAudioExpiresIn = time.Hour -) - const ( rawAudioCodec = "pcm_s16le" rawAudioFormat = "s16le" @@ -578,7 +573,6 @@ func (s *MediaSetService) getThumbnailFromYoutube(ctx context.Context, mediaSet type progressReader struct { io.Reader - label string total, exp int64 logger *zap.SugaredLogger }