@@ -365,7 +365,7 @@ func (j *JsonView) clearSearch() {
365365}
366366
367367func (j * JsonView ) setJson () * JsonView {
368- jMap := make (map [string ]interface {} )
368+ jMap := make (map [string ]any )
369369 if err := json .Unmarshal (j .jText , & jMap ); err != nil {
370370 tex := string (j .jText )
371371 sb := strings.Builder {}
@@ -403,7 +403,7 @@ func (j *JsonView) setJson() *JsonView {
403403 return j
404404}
405405
406- func (j * JsonView ) processNode (k , v interface {} , indent string , text * strings.Builder , last bool ) {
406+ func (j * JsonView ) processNode (k , v any , indent string , text * strings.Builder , last bool ) {
407407 word := j .captureWordSection (k , j .withSearchTag )
408408 if word != "" {
409409 k = word
@@ -417,17 +417,17 @@ func (j *JsonView) processNode(k, v interface{}, indent string, text *strings.Bu
417417 j .processNumeric (text , v , "" )
418418 case string :
419419 j .processString (text , v , "" )
420- case map [string ]interface {} :
420+ case map [string ]any :
421421 j .processObject (text , v , j .indent + indent )
422- case []interface {} :
422+ case []any :
423423 j .processArray (text , tp , j .indent + indent )
424424 }
425425 if ! last {
426426 text .WriteString ("," )
427427 }
428428}
429429
430- func (j * JsonView ) processArray (text * strings.Builder , tp []interface {} , indent string ) {
430+ func (j * JsonView ) processArray (text * strings.Builder , tp []any , indent string ) {
431431 text .WriteString ("[" + j .newLine ())
432432 kc := len (tp )
433433 i := 0
@@ -439,11 +439,11 @@ func (j *JsonView) processArray(text *strings.Builder, tp []interface{}, indent
439439 text .WriteString (j .computeIndent (indent [len (j .indent ):]) + "]" )
440440}
441441
442- func (j * JsonView ) processObject (text * strings.Builder , val interface {} , indent string ) {
442+ func (j * JsonView ) processObject (text * strings.Builder , val any , indent string ) {
443443 text .WriteString (color .ClString )
444444 text .WriteString (fmt .Sprintf (`[white::]{%s` , j .newLine ()))
445445
446- vmap := val .(map [string ]interface {} )
446+ vmap := val .(map [string ]any )
447447 kc := len (vmap )
448448 i := 0
449449
@@ -457,7 +457,7 @@ func (j *JsonView) processObject(text *strings.Builder, val interface{}, indent
457457 text .WriteString (indent [len (j .indent ):] + `}` )
458458}
459459
460- func (j * JsonView ) processString (text * strings.Builder , v interface {} , indent string ) {
460+ func (j * JsonView ) processString (text * strings.Builder , v any , indent string ) {
461461 val := fmt .Sprintf (`%v` , v )
462462 //val = strings.ReplaceAll(val, "\"", "\\\"")
463463 //val = strings.ReplaceAll(val, "\n", "\\n")
@@ -469,7 +469,7 @@ func (j *JsonView) processString(text *strings.Builder, v interface{}, indent st
469469 text .WriteString (color .ClWhite )
470470}
471471
472- func (j * JsonView ) processNumeric (text * strings.Builder , v interface {} , indent string ) {
472+ func (j * JsonView ) processNumeric (text * strings.Builder , v any , indent string ) {
473473 if word := j .captureWordSection (v , j .withSearchTag ); len (word ) > 0 {
474474 v = word
475475 }
@@ -478,25 +478,25 @@ func (j *JsonView) processNumeric(text *strings.Builder, v interface{}, indent s
478478 text .WriteString (color .ClWhite )
479479}
480480
481- func (j * JsonView ) processArrayItem (v interface {} , indent string , text * strings.Builder , last bool ) {
481+ func (j * JsonView ) processArrayItem (v any , indent string , text * strings.Builder , last bool ) {
482482 switch tp := v .(type ) {
483483 case int ,
484484 float64 ,
485485 bool :
486486 j .processNumeric (text , v , indent )
487487 case string :
488488 j .processString (text , v , indent )
489- case map [string ]interface {} :
489+ case map [string ]any :
490490 j .processObject (text , v , indent )
491- case []interface {} :
491+ case []any :
492492 j .processArray (text , tp , indent )
493493 }
494494 if ! last {
495495 text .WriteString ("," )
496496 }
497497}
498498
499- func (j * JsonView ) extractKeys (m map [string ]interface {} ) []string {
499+ func (j * JsonView ) extractKeys (m map [string ]any ) []string {
500500 var keys []string
501501 for k := range m {
502502 keys = append (keys , k )
@@ -520,7 +520,7 @@ func (j *JsonView) newLine() string {
520520 return ""
521521}
522522
523- func (j * JsonView ) captureWordSection (text interface {} , withTag string ) string {
523+ func (j * JsonView ) captureWordSection (text any , withTag string ) string {
524524 val := fmt .Sprintf ("%v" , text )
525525 tagged := len (withTag ) > 0
526526 sel := ""
0 commit comments