@@ -104,7 +104,7 @@ func (opts formatOptions) FormatDiffSlice(v *valueNode) textNode {
104104 case t .Kind () == reflect .String :
105105 sx , sy = vx .String (), vy .String ()
106106 isString = true
107- case t .Kind () == reflect .Slice && t .Elem () == reflect . TypeOf ( byte ( 0 )) :
107+ case t .Kind () == reflect .Slice && t .Elem () == byteType :
108108 sx , sy = string (vx .Bytes ()), string (vy .Bytes ())
109109 isString = true
110110 case t .Kind () == reflect .Array :
@@ -232,7 +232,7 @@ func (opts formatOptions) FormatDiffSlice(v *valueNode) textNode {
232232 var out textNode = & textWrap {Prefix : "(" , Value : list2 , Suffix : ")" }
233233 switch t .Kind () {
234234 case reflect .String :
235- if t != reflect . TypeOf ( string ( "" )) {
235+ if t != stringType {
236236 out = opts .FormatType (t , out )
237237 }
238238 case reflect .Slice :
@@ -327,12 +327,12 @@ func (opts formatOptions) FormatDiffSlice(v *valueNode) textNode {
327327 switch t .Kind () {
328328 case reflect .String :
329329 out = & textWrap {Prefix : "strings.Join(" , Value : out , Suffix : fmt .Sprintf (", %q)" , delim )}
330- if t != reflect . TypeOf ( string ( "" )) {
330+ if t != stringType {
331331 out = opts .FormatType (t , out )
332332 }
333333 case reflect .Slice :
334334 out = & textWrap {Prefix : "bytes.Join(" , Value : out , Suffix : fmt .Sprintf (", %q)" , delim )}
335- if t != reflect . TypeOf ([] byte ( nil )) {
335+ if t != bytesType {
336336 out = opts .FormatType (t , out )
337337 }
338338 }
0 commit comments