Fix formatting (gofmt -s for goreportcard.com)
This commit is contained in:
parent
b89e2c3429
commit
d5eb79ae28
3 changed files with 27 additions and 27 deletions
|
@ -59,12 +59,12 @@ func (testNestedLSlice) LoadToEagerLoad(exec Executor, singular bool, obj interf
|
||||||
switch x := obj.(type) {
|
switch x := obj.(type) {
|
||||||
case *testNestedSlice:
|
case *testNestedSlice:
|
||||||
x.R = &testNestedRSlice{
|
x.R = &testNestedRSlice{
|
||||||
[]*testNestedSlice{&testNestedSlice{ID: 5}},
|
[]*testNestedSlice{{ID: 5}},
|
||||||
}
|
}
|
||||||
case *[]*testNestedSlice:
|
case *[]*testNestedSlice:
|
||||||
for _, r := range *x {
|
for _, r := range *x {
|
||||||
r.R = &testNestedRSlice{
|
r.R = &testNestedRSlice{
|
||||||
[]*testNestedSlice{&testNestedSlice{ID: 5}},
|
[]*testNestedSlice{{ID: 5}},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -183,8 +183,8 @@ func TestLoadRelationshipsNoReload(t *testing.T) {
|
||||||
loadFunctionNestedCalled = 0
|
loadFunctionNestedCalled = 0
|
||||||
state := loadRelationshipState{
|
state := loadRelationshipState{
|
||||||
loaded: map[string]struct{}{
|
loaded: map[string]struct{}{
|
||||||
"ToEagerLoad": struct{}{},
|
"ToEagerLoad": {},
|
||||||
"ToEagerLoad.ToEagerLoad": struct{}{},
|
"ToEagerLoad.ToEagerLoad": {},
|
||||||
},
|
},
|
||||||
toLoad: []string{"ToEagerLoad", "ToEagerLoad"},
|
toLoad: []string{"ToEagerLoad", "ToEagerLoad"},
|
||||||
}
|
}
|
||||||
|
|
|
@ -166,28 +166,28 @@ func TestWhereClause(t *testing.T) {
|
||||||
// Or("a=?")
|
// Or("a=?")
|
||||||
{
|
{
|
||||||
q: Query{
|
q: Query{
|
||||||
where: []where{where{clause: "a=?", orSeparator: true}},
|
where: []where{{clause: "a=?", orSeparator: true}},
|
||||||
},
|
},
|
||||||
expect: " WHERE (a=$1)",
|
expect: " WHERE (a=$1)",
|
||||||
},
|
},
|
||||||
// Where("a=?")
|
// Where("a=?")
|
||||||
{
|
{
|
||||||
q: Query{
|
q: Query{
|
||||||
where: []where{where{clause: "a=?"}},
|
where: []where{{clause: "a=?"}},
|
||||||
},
|
},
|
||||||
expect: " WHERE (a=$1)",
|
expect: " WHERE (a=$1)",
|
||||||
},
|
},
|
||||||
// Where("(a=?)")
|
// Where("(a=?)")
|
||||||
{
|
{
|
||||||
q: Query{
|
q: Query{
|
||||||
where: []where{where{clause: "(a=?)"}},
|
where: []where{{clause: "(a=?)"}},
|
||||||
},
|
},
|
||||||
expect: " WHERE ((a=$1))",
|
expect: " WHERE ((a=$1))",
|
||||||
},
|
},
|
||||||
// Where("((a=? OR b=?))")
|
// Where("((a=? OR b=?))")
|
||||||
{
|
{
|
||||||
q: Query{
|
q: Query{
|
||||||
where: []where{where{clause: "((a=? OR b=?))"}},
|
where: []where{{clause: "((a=? OR b=?))"}},
|
||||||
},
|
},
|
||||||
expect: " WHERE (((a=$1 OR b=$2)))",
|
expect: " WHERE (((a=$1 OR b=$2)))",
|
||||||
},
|
},
|
||||||
|
@ -195,8 +195,8 @@ func TestWhereClause(t *testing.T) {
|
||||||
{
|
{
|
||||||
q: Query{
|
q: Query{
|
||||||
where: []where{
|
where: []where{
|
||||||
where{clause: "(a=?)"},
|
{clause: "(a=?)"},
|
||||||
where{clause: "(b=?)", orSeparator: true},
|
{clause: "(b=?)", orSeparator: true},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
expect: " WHERE ((a=$1)) OR ((b=$2))",
|
expect: " WHERE ((a=$1)) OR ((b=$2))",
|
||||||
|
@ -204,21 +204,21 @@ func TestWhereClause(t *testing.T) {
|
||||||
// Where("a=? OR b=?")
|
// Where("a=? OR b=?")
|
||||||
{
|
{
|
||||||
q: Query{
|
q: Query{
|
||||||
where: []where{where{clause: "a=? OR b=?"}},
|
where: []where{{clause: "a=? OR b=?"}},
|
||||||
},
|
},
|
||||||
expect: " WHERE (a=$1 OR b=$2)",
|
expect: " WHERE (a=$1 OR b=$2)",
|
||||||
},
|
},
|
||||||
// Where("a=?"), Where("b=?")
|
// Where("a=?"), Where("b=?")
|
||||||
{
|
{
|
||||||
q: Query{
|
q: Query{
|
||||||
where: []where{where{clause: "a=?"}, where{clause: "b=?"}},
|
where: []where{{clause: "a=?"}, {clause: "b=?"}},
|
||||||
},
|
},
|
||||||
expect: " WHERE (a=$1) AND (b=$2)",
|
expect: " WHERE (a=$1) AND (b=$2)",
|
||||||
},
|
},
|
||||||
// Where("(a=? AND b=?) OR c=?")
|
// Where("(a=? AND b=?) OR c=?")
|
||||||
{
|
{
|
||||||
q: Query{
|
q: Query{
|
||||||
where: []where{where{clause: "(a=? AND b=?) OR c=?"}},
|
where: []where{{clause: "(a=? AND b=?) OR c=?"}},
|
||||||
},
|
},
|
||||||
expect: " WHERE ((a=$1 AND b=$2) OR c=$3)",
|
expect: " WHERE ((a=$1 AND b=$2) OR c=$3)",
|
||||||
},
|
},
|
||||||
|
@ -226,8 +226,8 @@ func TestWhereClause(t *testing.T) {
|
||||||
{
|
{
|
||||||
q: Query{
|
q: Query{
|
||||||
where: []where{
|
where: []where{
|
||||||
where{clause: "(a=? OR b=?)"},
|
{clause: "(a=? OR b=?)"},
|
||||||
where{clause: "(c=? OR d=? OR e=?)"},
|
{clause: "(c=? OR d=? OR e=?)"},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
expect: " WHERE ((a=$1 OR b=$2)) AND ((c=$3 OR d=$4 OR e=$5))",
|
expect: " WHERE ((a=$1 OR b=$2)) AND ((c=$3 OR d=$4 OR e=$5))",
|
||||||
|
@ -236,7 +236,7 @@ func TestWhereClause(t *testing.T) {
|
||||||
{
|
{
|
||||||
q: Query{
|
q: Query{
|
||||||
where: []where{
|
where: []where{
|
||||||
where{clause: "(a=? AND b=?) OR (c=? AND d=? AND e=?) OR f=? OR g=?"},
|
{clause: "(a=? AND b=?) OR (c=? AND d=? AND e=?) OR f=? OR g=?"},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
expect: " WHERE ((a=$1 AND b=$2) OR (c=$3 AND d=$4 AND e=$5) OR f=$6 OR g=$7)",
|
expect: " WHERE ((a=$1 AND b=$2) OR (c=$3 AND d=$4 AND e=$5) OR f=$6 OR g=$7)",
|
||||||
|
@ -245,7 +245,7 @@ func TestWhereClause(t *testing.T) {
|
||||||
{
|
{
|
||||||
q: Query{
|
q: Query{
|
||||||
where: []where{
|
where: []where{
|
||||||
where{clause: "(a=? AND b=?) OR (c=? AND d=? OR e=?) OR f=? OR g=?"},
|
{clause: "(a=? AND b=?) OR (c=? AND d=? OR e=?) OR f=? OR g=?"},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
expect: " WHERE ((a=$1 AND b=$2) OR (c=$3 AND d=$4 OR e=$5) OR f=$6 OR g=$7)",
|
expect: " WHERE ((a=$1 AND b=$2) OR (c=$3 AND d=$4 OR e=$5) OR f=$6 OR g=$7)",
|
||||||
|
@ -254,9 +254,9 @@ func TestWhereClause(t *testing.T) {
|
||||||
{
|
{
|
||||||
q: Query{
|
q: Query{
|
||||||
where: []where{
|
where: []where{
|
||||||
where{clause: "a=? or b=?", orSeparator: true},
|
{clause: "a=? or b=?", orSeparator: true},
|
||||||
where{clause: "c=? and d=?", orSeparator: true},
|
{clause: "c=? and d=?", orSeparator: true},
|
||||||
where{clause: "e=? or f=?", orSeparator: true},
|
{clause: "e=? or f=?", orSeparator: true},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
expect: " WHERE (a=$1 or b=$2) OR (c=$3 and d=$4) OR (e=$5 or f=$6)",
|
expect: " WHERE (a=$1 or b=$2) OR (c=$3 and d=$4) OR (e=$5 or f=$6)",
|
||||||
|
@ -265,9 +265,9 @@ func TestWhereClause(t *testing.T) {
|
||||||
{
|
{
|
||||||
q: Query{
|
q: Query{
|
||||||
where: []where{
|
where: []where{
|
||||||
where{clause: "a=? or b=?"},
|
{clause: "a=? or b=?"},
|
||||||
where{clause: "c=? and d=?", orSeparator: true},
|
{clause: "c=? and d=?", orSeparator: true},
|
||||||
where{clause: "e=? or f=?"},
|
{clause: "e=? or f=?"},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
expect: " WHERE (a=$1 or b=$2) OR (c=$3 and d=$4) AND (e=$5 or f=$6)",
|
expect: " WHERE (a=$1 or b=$2) OR (c=$3 and d=$4) AND (e=$5 or f=$6)",
|
||||||
|
|
|
@ -18,10 +18,10 @@ var (
|
||||||
)
|
)
|
||||||
|
|
||||||
var uppercaseWords = map[string]struct{}{
|
var uppercaseWords = map[string]struct{}{
|
||||||
"guid": struct{}{},
|
"guid": {},
|
||||||
"id": struct{}{},
|
"id": {},
|
||||||
"uid": struct{}{},
|
"uid": {},
|
||||||
"uuid": struct{}{},
|
"uuid": {},
|
||||||
}
|
}
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
|
|
Loading…
Add table
Reference in a new issue