File tree Expand file tree Collapse file tree 2 files changed +8
-8
lines changed
Expand file tree Collapse file tree 2 files changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -57,12 +57,12 @@ func (g *GzippedText) Scan(src interface{}) error {
5757// implements `Unmarshal`, which unmarshals the json within to an interface{}
5858type JSONText json.RawMessage
5959
60- var _EMPTY_JSON = JSONText ("{}" )
60+ var emptyJSON = JSONText ("{}" )
6161
6262// MarshalJSON returns the *j as the JSON encoding of j.
6363func (j * JSONText ) MarshalJSON () ([]byte , error ) {
6464 if len (* j ) == 0 {
65- * j = _EMPTY_JSON
65+ * j = emptyJSON
6666 }
6767 return * j , nil
6868}
@@ -95,12 +95,12 @@ func (j *JSONText) Scan(src interface{}) error {
9595 source = []byte (t )
9696 case []byte :
9797 if len (t ) == 0 {
98- source = _EMPTY_JSON
98+ source = emptyJSON
9999 } else {
100100 source = t
101101 }
102102 case nil :
103- * j = _EMPTY_JSON
103+ * j = emptyJSON
104104 default :
105105 return errors .New ("Incompatible type for JSONText" )
106106 }
@@ -111,7 +111,7 @@ func (j *JSONText) Scan(src interface{}) error {
111111// Unmarshal unmarshal's the json in j to v, as in json.Unmarshal.
112112func (j * JSONText ) Unmarshal (v interface {}) error {
113113 if len (* j ) == 0 {
114- * j = _EMPTY_JSON
114+ * j = emptyJSON
115115 }
116116 return json .Unmarshal ([]byte (* j ), v )
117117}
@@ -132,7 +132,7 @@ type NullJSONText struct {
132132// Scan implements the Scanner interface.
133133func (n * NullJSONText ) Scan (value interface {}) error {
134134 if value == nil {
135- n .JSONText , n .Valid = _EMPTY_JSON , false
135+ n .JSONText , n .Valid = emptyJSON , false
136136 return nil
137137 }
138138 n .Valid = true
Original file line number Diff line number Diff line change @@ -107,7 +107,7 @@ func TestBitBool(t *testing.T) {
107107 t .Errorf ("Was not expecting an error" )
108108 }
109109 if ! b {
110- t .Errorf ("Was expecting the bool we sent in (true), got %b " , b )
110+ t .Errorf ("Was expecting the bool we sent in (true), got %v " , b )
111111 }
112112
113113 // Test false value
@@ -122,6 +122,6 @@ func TestBitBool(t *testing.T) {
122122 t .Errorf ("Was not expecting an error" )
123123 }
124124 if b {
125- t .Errorf ("Was expecting the bool we sent in (false), got %b " , b )
125+ t .Errorf ("Was expecting the bool we sent in (false), got %v " , b )
126126 }
127127}
You can’t perform that action at this time.
0 commit comments