Skip to content

Commit e998a99

Browse files
remove additional whitespaces
1 parent b8d342f commit e998a99

File tree

2 files changed

+1
-16
lines changed

2 files changed

+1
-16
lines changed

query/encode.go

+1-6
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,6 @@ type Encoder interface {
111111
// values using Ruby format, and would lead to recursive serialization of all the nested struct
112112
// fields and slice/array within that struct as well (This was added in PR # 48)
113113
//
114-
//
115114
// Anonymous struct fields are usually encoded as if their inner exported
116115
// fields were fields in the outer struct, subject to the standard Go
117116
// visibility rules. An anonymous struct field with a name given in its URL
@@ -124,8 +123,6 @@ type Encoder interface {
124123
//
125124
// "user[name]=acme&user[addr][postcode]=1234&user[addr][city]=SFO"
126125
//
127-
//
128-
//
129126
// All other values are encoded using their default string representation.
130127
//
131128
// Multiple fields that encode to the same URL parameter name will be included
@@ -165,7 +162,6 @@ func reflectValue(values url.Values, val reflect.Value, scope string) error {
165162
var scopes map[*reflect.Value]string
166163

167164
typ := val.Type()
168-
169165
for i := 0; i < typ.NumField(); i++ {
170166
sf := typ.Field(i)
171167
if sf.PkgPath != "" && !sf.Anonymous { // unexported
@@ -177,7 +173,6 @@ func reflectValue(values url.Values, val reflect.Value, scope string) error {
177173
if tag == "-" {
178174
continue
179175
}
180-
181176
name, opts := parseTag(tag)
182177

183178
if name == "" {
@@ -346,7 +341,7 @@ func valueString(v reflect.Value, opts tagOptions, sf reflect.StructField) strin
346341
}
347342

348343
// isEmptyValue checks if a value should be considered empty for the purposes
349-
// of omit ting fields with the "omitempty" option.
344+
// of omitting fields with the "omitempty" option.
350345
func isEmptyValue(v reflect.Value) bool {
351346
switch v.Kind() {
352347
case reflect.Array, reflect.Map, reflect.Slice, reflect.String:

query/encode_test.go

-10
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@ func TestValues_BasicTypes(t *testing.T) {
5252
}{false},
5353
url.Values{"V": {"0"}},
5454
},
55-
5655
{
5756
struct {
5857
V bool `url:",int"`
@@ -134,9 +133,7 @@ func TestValues_Pointers(t *testing.T) {
134133
}
135134
}
136135

137-
// IMPORTANT
138136
func TestValues_Slices(t *testing.T) {
139-
// The base struct could be abstracted
140137
tests := []struct {
141138
input interface{}
142139
want url.Values
@@ -146,7 +143,6 @@ func TestValues_Slices(t *testing.T) {
146143
struct{ V []string }{},
147144
url.Values{},
148145
},
149-
150146
{
151147
struct{ V []string }{[]string{"a", "b"}},
152148
url.Values{"V": {"a", "b"}},
@@ -465,25 +461,20 @@ func TestValues_EmbeddedStructs(t *testing.T) {
465461
type Inner struct {
466462
V string
467463
}
468-
469464
type Outer struct {
470465
Inner
471466
}
472-
473467
type OuterPtr struct {
474468
*Inner
475469
}
476-
477470
type Mixed struct {
478471
Inner
479472
V string
480473
}
481-
482474
type unexported struct {
483475
Inner
484476
V string
485477
}
486-
487478
type Exported struct {
488479
unexported
489480
}
@@ -503,7 +494,6 @@ func TestValues_EmbeddedStructs(t *testing.T) {
503494
{
504495
// This step would happen before anything else, so we need not worry about it
505496
Mixed{Inner: Inner{V: "a"}, V: "b"},
506-
507497
url.Values{"V": {"b", "a"}},
508498
},
509499
{

0 commit comments

Comments
 (0)