Skip to content

Commit

Permalink
Merge branch 'master' into dependabot/go_modules/github.com/NYTimes/g…
Browse files Browse the repository at this point in the history
…izmo-1.2.17
  • Loading branch information
fsouza committed Sep 17, 2019
2 parents 95ebd9b + fe9b49a commit 2b3143f
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 13 deletions.
16 changes: 16 additions & 0 deletions .golangci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
run:
deadline: 5m

linters:
enable-all: true
disable:
- dupl
- errcheck
- funlen
- gochecknoglobals
- gochecknoinits
- goconst
- gocritic
- gocyclo
- lll
- unparam
15 changes: 2 additions & 13 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,24 +6,13 @@ LOG_LEVEL ?= debug
all: test

testdeps:
GO111MODULE=off go get github.com/golangci/golangci-lint/cmd/golangci-lint
cd /tmp && GO111MODULE=on go get github.com/golangci/golangci-lint/cmd/golangci-lint@latest
go mod download

lint: testdeps runlint

runlint:
golangci-lint run \
--enable-all \
-D errcheck \
-D lll \
-D gochecknoglobals \
-D goconst \
-D gocyclo \
-D dupl \
-D gocritic \
-D gochecknoinits \
-D unparam \
--deadline 5m ./...
golangci-lint run

gotest:
go test -race -vet=all -mod=readonly $(GO_TEST_EXTRA_FLAGS) ./...
Expand Down
3 changes: 3 additions & 0 deletions internal/provider/encodingcom/encodingcom.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,12 @@ type encodingComProvider struct {
func (e *encodingComProvider) Transcode(job *db.Job) (*provider.JobStatus, error) {
formats, err := e.presetsToFormats(job)
if err != nil {
//nolint:stylecheck
return nil, fmt.Errorf("Error converting presets to formats on Transcode operation: %s", err.Error())
}
resp, err := e.client.AddMedia([]string{e.sourceMedia(job.SourceMedia)}, formats, e.config.EncodingCom.Region)
if err != nil {
//nolint:stylecheck
return nil, fmt.Errorf("Error making AddMedia request for Transcode operation: %s", err.Error())
}
return &provider.JobStatus{
Expand Down Expand Up @@ -184,6 +186,7 @@ func (e *encodingComProvider) presetsToFormats(job *db.Job) ([]encodingcom.Forma
}
presetOutput, err := e.GetPreset(presetID)
if err != nil {
//nolint:stylecheck
return nil, fmt.Errorf("Error getting preset info: %s", err.Error())
}
presetStruct := presetOutput.(*encodingcom.Preset)
Expand Down

0 comments on commit 2b3143f

Please sign in to comment.