format with gofumports
This commit is contained in:
@@ -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)
|
||||||
|
|||||||
@@ -1,8 +1,6 @@
|
|||||||
package model
|
package model
|
||||||
|
|
||||||
import (
|
import "time"
|
||||||
"time"
|
|
||||||
)
|
|
||||||
|
|
||||||
type CrudBase struct {
|
type CrudBase struct {
|
||||||
CreatedAt time.Time
|
CreatedAt time.Time
|
||||||
|
|||||||
@@ -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": {},
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
@@ -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 {
|
||||||
|
|||||||
@@ -1,8 +1,6 @@
|
|||||||
package subsonic
|
package subsonic
|
||||||
|
|
||||||
import (
|
import "time"
|
||||||
"time"
|
|
||||||
)
|
|
||||||
|
|
||||||
var (
|
var (
|
||||||
apiVersion = "1.9.0"
|
apiVersion = "1.9.0"
|
||||||
|
|||||||
Reference in New Issue
Block a user