aboutsummaryrefslogtreecommitdiff
path: root/lib/text/string.go
diff options
context:
space:
mode:
Diffstat (limited to 'lib/text/string.go')
-rw-r--r--lib/text/string.go12
1 files changed, 10 insertions, 2 deletions
diff --git a/lib/text/string.go b/lib/text/string.go
index 4e654cf4..27aa2aa3 100644
--- a/lib/text/string.go
+++ b/lib/text/string.go
@@ -1,5 +1,13 @@
+// Copyright 2018, Shulhan <ms@kilabit.info>. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
package text
+import (
+ libbytes "github.com/shuLhan/share/lib/bytes"
+)
+
//
// StringJSONEscape escape the following character: `"` (quotation mark),
// `\` (reverse solidus), `/` (solidus), `\b` (backspace), `\f` (formfeed),
@@ -16,7 +24,7 @@ func StringJSONEscape(in string) string {
}
bin := []byte(in)
- bout := BytesJSONEscape(bin)
+ bout := libbytes.JSONEscape(bin)
return string(bout)
}
@@ -36,7 +44,7 @@ func StringJSONUnescape(in string, strict bool) (string, error) {
}
bin := []byte(in)
- bout, err := BytesJSONUnescape(bin, strict)
+ bout, err := libbytes.JSONUnescape(bin, strict)
out := string(bout)