diff options
| author | Shulhan <ms@kilabit.info> | 2018-09-03 22:27:44 +0700 |
|---|---|---|
| committer | Shulhan <ms@kilabit.info> | 2018-09-03 22:55:06 +0700 |
| commit | d3e6c2e902eb3a00c2dfdcde09bf35282ea63396 (patch) | |
| tree | 63432c09e0dddb08942e7172f24666a811432bb5 /lib/text/string.go | |
| parent | aab053ef5c49bcc67f6de5477d9760ea4e3bf6ab (diff) | |
| download | pakakeh.go-d3e6c2e902eb3a00c2dfdcde09bf35282ea63396.tar.xz | |
Move all byte(s) related constant and functions from package text to bytes
Diffstat (limited to 'lib/text/string.go')
| -rw-r--r-- | lib/text/string.go | 12 |
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) |
