From 4eaa18b5c795a63a902ab6780f09da997123943d Mon Sep 17 00:00:00 2001 From: kolaente Date: Thu, 17 Dec 2020 01:56:08 +0100 Subject: [PATCH] Fix lint --- magefile.go | 8 +++++--- pkg/modules/migration/create_from_structure.go | 2 +- pkg/modules/migration/trello/trello_test.go | 7 ++++--- pkg/routes/api/v1/info.go | 3 ++- pkg/routes/routes.go | 3 ++- 5 files changed, 14 insertions(+), 9 deletions(-) diff --git a/magefile.go b/magefile.go index d1e9922a5..d360ab6a0 100644 --- a/magefile.go +++ b/magefile.go @@ -24,9 +24,6 @@ import ( "context" "crypto/sha256" "fmt" - "github.com/magefile/mage/mg" - "golang.org/x/sync/errgroup" - "gopkg.in/yaml.v3" "io" "io/ioutil" "os" @@ -35,6 +32,10 @@ import ( "runtime" "strings" "time" + + "github.com/magefile/mage/mg" + "golang.org/x/sync/errgroup" + "gopkg.in/yaml.v3" ) const ( @@ -65,6 +66,7 @@ var ( "release:os-package": Release.OsPackage, "dev:create-migration": Dev.CreateMigration, "generate-docs": GenerateDocs, + "check:golangci-fix": Check.GolangciFix, } ) diff --git a/pkg/modules/migration/create_from_structure.go b/pkg/modules/migration/create_from_structure.go index 5cdfa74d7..b6f69503b 100644 --- a/pkg/modules/migration/create_from_structure.go +++ b/pkg/modules/migration/create_from_structure.go @@ -209,7 +209,7 @@ func InsertFromStructure(str []*models.NamespaceWithLists, user *user.User) (err return err } buckets := bucketsIn.([]*models.Bucket) - buckets[0].Delete() + err = buckets[0].Delete() if err != nil { return err } diff --git a/pkg/modules/migration/trello/trello_test.go b/pkg/modules/migration/trello/trello_test.go index c957c56b6..cba0951df 100644 --- a/pkg/modules/migration/trello/trello_test.go +++ b/pkg/modules/migration/trello/trello_test.go @@ -17,15 +17,16 @@ package trello import ( + "io/ioutil" + "testing" + "time" + "code.vikunja.io/api/pkg/config" "code.vikunja.io/api/pkg/files" "code.vikunja.io/api/pkg/models" "github.com/adlio/trello" "github.com/d4l3k/messagediff" "github.com/stretchr/testify/assert" - "io/ioutil" - "testing" - "time" ) func TestConvertTrelloToVikunja(t *testing.T) { diff --git a/pkg/routes/api/v1/info.go b/pkg/routes/api/v1/info.go index b13e50cf9..a9833a8c9 100644 --- a/pkg/routes/api/v1/info.go +++ b/pkg/routes/api/v1/info.go @@ -17,9 +17,10 @@ package v1 import ( - "code.vikunja.io/api/pkg/modules/migration/trello" "net/http" + "code.vikunja.io/api/pkg/modules/migration/trello" + "code.vikunja.io/api/pkg/log" "code.vikunja.io/api/pkg/config" diff --git a/pkg/routes/routes.go b/pkg/routes/routes.go index a5680f08f..a8ca3ec76 100644 --- a/pkg/routes/routes.go +++ b/pkg/routes/routes.go @@ -47,10 +47,11 @@ package routes import ( - "code.vikunja.io/api/pkg/modules/migration/trello" "strings" "time" + "code.vikunja.io/api/pkg/modules/migration/trello" + "code.vikunja.io/api/pkg/config" "code.vikunja.io/api/pkg/log" "code.vikunja.io/api/pkg/models"