File tree Expand file tree Collapse file tree 2 files changed +24
-5
lines changed Expand file tree Collapse file tree 2 files changed +24
-5
lines changed Original file line number Diff line number Diff line change 1- module " github.com/cortexlabs/yaml"
1+ module github.com/cortexlabs/yaml
22
3- require (
4- " gopkg.in/check.v1" v0.0.0-20161208181325-20d25e280405
5- )
3+ require gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405
Original file line number Diff line number Diff line change @@ -485,9 +485,30 @@ func EscapeAtSymbol(str string) (string, bool) {
485485 return str , false
486486}
487487
488- func UnescapeAtSymbol (str string ) (string , bool ) {
488+ func UnescapeAtSymbol (str string ) string {
489+ if strings .HasPrefix (str , atSymbolEscapeSeq ) {
490+ return "@" + str [len (atSymbolEscapeSeq ):]
491+ }
492+ return str
493+ }
494+
495+ func UnescapeAtSymbolOk (str string ) (string , bool ) {
489496 if strings .HasPrefix (str , atSymbolEscapeSeq ) {
490497 return "@" + str [len (atSymbolEscapeSeq ):], true
491498 }
492499 return str , false
493500}
501+
502+ func UnescapeAllAtSymbols (str string ) string {
503+ if strings .Contains (str , atSymbolEscapeSeq ) {
504+ return strings .ReplaceAll (str , atSymbolEscapeSeq , "@" )
505+ }
506+ return str
507+ }
508+
509+ func UnescapeAllAtSymbolsOk (str string ) (string , bool ) {
510+ if strings .Contains (str , atSymbolEscapeSeq ) {
511+ return strings .ReplaceAll (str , atSymbolEscapeSeq , "@" ), true
512+ }
513+ return str , false
514+ }
You can’t perform that action at this time.
0 commit comments