format with gofumports

This commit is contained in:
sentriz
2019-06-27 21:06:51 +01:00
parent 39590daa39
commit 12b9810ca1
6 changed files with 20 additions and 26 deletions

View File

@@ -12,9 +12,7 @@ import (
"github.com/sentriz/gonic/scanner" "github.com/sentriz/gonic/scanner"
) )
const ( const programName = "gonicscan"
programName = "gonicscan"
)
func main() { func main() {
set := flag.NewFlagSet(programName, flag.ExitOnError) set := flag.NewFlagSet(programName, flag.ExitOnError)

View File

@@ -1,8 +1,6 @@
package model package model
import ( import "time"
"time"
)
type CrudBase struct { type CrudBase struct {
CreatedAt time.Time CreatedAt time.Time

View File

@@ -19,9 +19,7 @@ import (
"github.com/sentriz/gonic/scanner/tags" "github.com/sentriz/gonic/scanner/tags"
) )
var ( var IsScanning int32
IsScanning int32
)
var coverFilenames = map[string]struct{}{ var coverFilenames = map[string]struct{}{
"cover.png": {}, "cover.png": {},

View File

@@ -1,8 +1,6 @@
package handler package handler
import ( import "testing"
"testing"
)
func TestFirstExisting(t *testing.T) { func TestFirstExisting(t *testing.T) {
cases := []struct { cases := []struct {
@@ -11,15 +9,21 @@ func TestFirstExisting(t *testing.T) {
or string or string
exp string exp string
}{ }{
{"none present", {
"none present",
[]string{"one", "two", "three"}, "default", []string{"one", "two", "three"}, "default",
"one"}, "one",
{"first missing", },
{
"first missing",
[]string{"", "two", "three"}, "default", []string{"", "two", "three"}, "default",
"two"}, "two",
{"all missing", },
{
"all missing",
[]string{"", "", ""}, "default", []string{"", "", ""}, "default",
"default"}, "default",
},
} }
for _, tc := range cases { for _, tc := range cases {
tc := tc // pin tc := tc // pin

View File

@@ -9,11 +9,9 @@ import (
"net/url" "net/url"
) )
var ( var requiredParameters = []string{
requiredParameters = []string{ "u", "v", "c",
"u", "v", "c", }
}
)
func checkHasAllParams(params url.Values) error { func checkHasAllParams(params url.Values) error {
for _, req := range requiredParameters { for _, req := range requiredParameters {

View File

@@ -1,8 +1,6 @@
package subsonic package subsonic
import ( import "time"
"time"
)
var ( var (
apiVersion = "1.9.0" apiVersion = "1.9.0"