diff --git a/cmd/gonicscan/main.go b/cmd/gonicscan/main.go index c4175d8..3a8ad05 100644 --- a/cmd/gonicscan/main.go +++ b/cmd/gonicscan/main.go @@ -12,9 +12,7 @@ import ( "github.com/sentriz/gonic/scanner" ) -const ( - programName = "gonicscan" -) +const programName = "gonicscan" func main() { set := flag.NewFlagSet(programName, flag.ExitOnError) diff --git a/model/base.go b/model/base.go index ee61124..c86b906 100644 --- a/model/base.go +++ b/model/base.go @@ -1,8 +1,6 @@ package model -import ( - "time" -) +import "time" type CrudBase struct { CreatedAt time.Time diff --git a/scanner/scanner.go b/scanner/scanner.go index 96a0a97..8d1dcc0 100644 --- a/scanner/scanner.go +++ b/scanner/scanner.go @@ -19,9 +19,7 @@ import ( "github.com/sentriz/gonic/scanner/tags" ) -var ( - IsScanning int32 -) +var IsScanning int32 var coverFilenames = map[string]struct{}{ "cover.png": {}, diff --git a/server/handler/handler_admin_utils_test.go b/server/handler/handler_admin_utils_test.go index 1d08566..a2a2f2f 100644 --- a/server/handler/handler_admin_utils_test.go +++ b/server/handler/handler_admin_utils_test.go @@ -1,8 +1,6 @@ package handler -import ( - "testing" -) +import "testing" func TestFirstExisting(t *testing.T) { cases := []struct { @@ -11,15 +9,21 @@ func TestFirstExisting(t *testing.T) { or string exp string }{ - {"none present", + { + "none present", []string{"one", "two", "three"}, "default", - "one"}, - {"first missing", + "one", + }, + { + "first missing", []string{"", "two", "three"}, "default", - "two"}, - {"all missing", + "two", + }, + { + "all missing", []string{"", "", ""}, "default", - "default"}, + "default", + }, } for _, tc := range cases { tc := tc // pin diff --git a/server/handler/middleware_sub.go b/server/handler/middleware_sub.go index 3c06811..7b49e58 100644 --- a/server/handler/middleware_sub.go +++ b/server/handler/middleware_sub.go @@ -9,11 +9,9 @@ import ( "net/url" ) -var ( - requiredParameters = []string{ - "u", "v", "c", - } -) +var requiredParameters = []string{ + "u", "v", "c", +} func checkHasAllParams(params url.Values) error { for _, req := range requiredParameters { diff --git a/server/subsonic/subsonic.go b/server/subsonic/subsonic.go index 711d8b6..2059257 100644 --- a/server/subsonic/subsonic.go +++ b/server/subsonic/subsonic.go @@ -1,8 +1,6 @@ package subsonic -import ( - "time" -) +import "time" var ( apiVersion = "1.9.0"