From d5eb79ae28a3f5e3ce9fcf9aad6e523f107f1171 Mon Sep 17 00:00:00 2001 From: Patrick O'brien Date: Mon, 5 Sep 2016 21:47:17 +1000 Subject: [PATCH] Fix formatting (gofmt -s for goreportcard.com) --- boil/eager_load_test.go | 8 ++++---- boil/query_builders_test.go | 38 ++++++++++++++++++------------------- strmangle/strmangle.go | 8 ++++---- 3 files changed, 27 insertions(+), 27 deletions(-) diff --git a/boil/eager_load_test.go b/boil/eager_load_test.go index cdcd033..86ada1a 100644 --- a/boil/eager_load_test.go +++ b/boil/eager_load_test.go @@ -59,12 +59,12 @@ func (testNestedLSlice) LoadToEagerLoad(exec Executor, singular bool, obj interf switch x := obj.(type) { case *testNestedSlice: x.R = &testNestedRSlice{ - []*testNestedSlice{&testNestedSlice{ID: 5}}, + []*testNestedSlice{{ID: 5}}, } case *[]*testNestedSlice: for _, r := range *x { r.R = &testNestedRSlice{ - []*testNestedSlice{&testNestedSlice{ID: 5}}, + []*testNestedSlice{{ID: 5}}, } } } @@ -183,8 +183,8 @@ func TestLoadRelationshipsNoReload(t *testing.T) { loadFunctionNestedCalled = 0 state := loadRelationshipState{ loaded: map[string]struct{}{ - "ToEagerLoad": struct{}{}, - "ToEagerLoad.ToEagerLoad": struct{}{}, + "ToEagerLoad": {}, + "ToEagerLoad.ToEagerLoad": {}, }, toLoad: []string{"ToEagerLoad", "ToEagerLoad"}, } diff --git a/boil/query_builders_test.go b/boil/query_builders_test.go index 33be7d9..b5035d8 100644 --- a/boil/query_builders_test.go +++ b/boil/query_builders_test.go @@ -166,28 +166,28 @@ func TestWhereClause(t *testing.T) { // Or("a=?") { q: Query{ - where: []where{where{clause: "a=?", orSeparator: true}}, + where: []where{{clause: "a=?", orSeparator: true}}, }, expect: " WHERE (a=$1)", }, // Where("a=?") { q: Query{ - where: []where{where{clause: "a=?"}}, + where: []where{{clause: "a=?"}}, }, expect: " WHERE (a=$1)", }, // Where("(a=?)") { q: Query{ - where: []where{where{clause: "(a=?)"}}, + where: []where{{clause: "(a=?)"}}, }, expect: " WHERE ((a=$1))", }, // Where("((a=? OR b=?))") { q: Query{ - where: []where{where{clause: "((a=? OR b=?))"}}, + where: []where{{clause: "((a=? OR b=?))"}}, }, expect: " WHERE (((a=$1 OR b=$2)))", }, @@ -195,8 +195,8 @@ func TestWhereClause(t *testing.T) { { q: Query{ where: []where{ - where{clause: "(a=?)"}, - where{clause: "(b=?)", orSeparator: true}, + {clause: "(a=?)"}, + {clause: "(b=?)", orSeparator: true}, }, }, expect: " WHERE ((a=$1)) OR ((b=$2))", @@ -204,21 +204,21 @@ func TestWhereClause(t *testing.T) { // Where("a=? OR b=?") { q: Query{ - where: []where{where{clause: "a=? OR b=?"}}, + where: []where{{clause: "a=? OR b=?"}}, }, expect: " WHERE (a=$1 OR b=$2)", }, // Where("a=?"), Where("b=?") { q: Query{ - where: []where{where{clause: "a=?"}, where{clause: "b=?"}}, + where: []where{{clause: "a=?"}, {clause: "b=?"}}, }, expect: " WHERE (a=$1) AND (b=$2)", }, // Where("(a=? AND b=?) OR c=?") { 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)", }, @@ -226,8 +226,8 @@ func TestWhereClause(t *testing.T) { { q: Query{ where: []where{ - where{clause: "(a=? OR b=?)"}, - where{clause: "(c=? OR d=? OR e=?)"}, + {clause: "(a=? OR b=?)"}, + {clause: "(c=? OR d=? OR e=?)"}, }, }, 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{ 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)", @@ -245,7 +245,7 @@ func TestWhereClause(t *testing.T) { { q: Query{ 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)", @@ -254,9 +254,9 @@ func TestWhereClause(t *testing.T) { { q: Query{ where: []where{ - where{clause: "a=? or b=?", orSeparator: true}, - where{clause: "c=? and d=?", orSeparator: true}, - where{clause: "e=? or f=?", orSeparator: true}, + {clause: "a=? or b=?", orSeparator: true}, + {clause: "c=? and d=?", 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)", @@ -265,9 +265,9 @@ func TestWhereClause(t *testing.T) { { q: Query{ where: []where{ - where{clause: "a=? or b=?"}, - where{clause: "c=? and d=?", orSeparator: true}, - where{clause: "e=? or f=?"}, + {clause: "a=? or b=?"}, + {clause: "c=? and d=?", orSeparator: true}, + {clause: "e=? or f=?"}, }, }, expect: " WHERE (a=$1 or b=$2) OR (c=$3 and d=$4) AND (e=$5 or f=$6)", diff --git a/strmangle/strmangle.go b/strmangle/strmangle.go index 7faa68f..8228919 100644 --- a/strmangle/strmangle.go +++ b/strmangle/strmangle.go @@ -18,10 +18,10 @@ var ( ) var uppercaseWords = map[string]struct{}{ - "guid": struct{}{}, - "id": struct{}{}, - "uid": struct{}{}, - "uuid": struct{}{}, + "guid": {}, + "id": {}, + "uid": {}, + "uuid": {}, } func init() {