File tree 1 file changed +16
-16
lines changed
1 file changed +16
-16
lines changed Original file line number Diff line number Diff line change @@ -652,32 +652,32 @@ func escapeBytesBackslash(buf, v []byte) []byte {
652
652
for _ , c := range v {
653
653
switch c {
654
654
case '\x00' :
655
- buf [pos ] = '\\'
656
655
buf [pos + 1 ] = '0'
656
+ buf [pos ] = '\\'
657
657
pos += 2
658
658
case '\n' :
659
- buf [pos ] = '\\'
660
659
buf [pos + 1 ] = 'n'
660
+ buf [pos ] = '\\'
661
661
pos += 2
662
662
case '\r' :
663
- buf [pos ] = '\\'
664
663
buf [pos + 1 ] = 'r'
664
+ buf [pos ] = '\\'
665
665
pos += 2
666
666
case '\x1a' :
667
- buf [pos ] = '\\'
668
667
buf [pos + 1 ] = 'Z'
668
+ buf [pos ] = '\\'
669
669
pos += 2
670
670
case '\'' :
671
- buf [pos ] = '\\'
672
671
buf [pos + 1 ] = '\''
672
+ buf [pos ] = '\\'
673
673
pos += 2
674
674
case '"' :
675
- buf [pos ] = '\\'
676
675
buf [pos + 1 ] = '"'
676
+ buf [pos ] = '\\'
677
677
pos += 2
678
678
case '\\' :
679
- buf [pos ] = '\\'
680
679
buf [pos + 1 ] = '\\'
680
+ buf [pos ] = '\\'
681
681
pos += 2
682
682
default :
683
683
buf [pos ] = c
@@ -697,32 +697,32 @@ func escapeStringBackslash(buf []byte, v string) []byte {
697
697
c := v [i ]
698
698
switch c {
699
699
case '\x00' :
700
- buf [pos ] = '\\'
701
700
buf [pos + 1 ] = '0'
701
+ buf [pos ] = '\\'
702
702
pos += 2
703
703
case '\n' :
704
- buf [pos ] = '\\'
705
704
buf [pos + 1 ] = 'n'
705
+ buf [pos ] = '\\'
706
706
pos += 2
707
707
case '\r' :
708
- buf [pos ] = '\\'
709
708
buf [pos + 1 ] = 'r'
709
+ buf [pos ] = '\\'
710
710
pos += 2
711
711
case '\x1a' :
712
- buf [pos ] = '\\'
713
712
buf [pos + 1 ] = 'Z'
713
+ buf [pos ] = '\\'
714
714
pos += 2
715
715
case '\'' :
716
- buf [pos ] = '\\'
717
716
buf [pos + 1 ] = '\''
717
+ buf [pos ] = '\\'
718
718
pos += 2
719
719
case '"' :
720
- buf [pos ] = '\\'
721
720
buf [pos + 1 ] = '"'
721
+ buf [pos ] = '\\'
722
722
pos += 2
723
723
case '\\' :
724
- buf [pos ] = '\\'
725
724
buf [pos + 1 ] = '\\'
725
+ buf [pos ] = '\\'
726
726
pos += 2
727
727
default :
728
728
buf [pos ] = c
@@ -744,8 +744,8 @@ func escapeBytesQuotes(buf, v []byte) []byte {
744
744
745
745
for _ , c := range v {
746
746
if c == '\'' {
747
- buf [pos ] = '\''
748
747
buf [pos + 1 ] = '\''
748
+ buf [pos ] = '\''
749
749
pos += 2
750
750
} else {
751
751
buf [pos ] = c
@@ -764,8 +764,8 @@ func escapeStringQuotes(buf []byte, v string) []byte {
764
764
for i := 0 ; i < len (v ); i ++ {
765
765
c := v [i ]
766
766
if c == '\'' {
767
- buf [pos ] = '\''
768
767
buf [pos + 1 ] = '\''
768
+ buf [pos ] = '\''
769
769
pos += 2
770
770
} else {
771
771
buf [pos ] = c
You can’t perform that action at this time.
0 commit comments