github.com/urso/go-structform@v0.0.2/json/defs.go (about)

     1  package json
     2  
     3  import "github.com/urso/go-structform/internal/unsafe"
     4  
     5  var (
     6  	nullSymbol  = []byte("null")
     7  	trueSymbol  = []byte("true")
     8  	falseSymbol = []byte("false")
     9  	commaSymbol = []byte(",")
    10  
    11  	invalidCharSym = []byte(`\ufffd`)
    12  )
    13  
    14  func str2Bytes(s string) []byte {
    15  	return unsafe.Str2Bytes(s)
    16  }
    17  
    18  func bytes2Str(b []byte) string {
    19  	return unsafe.Bytes2Str(b)
    20  }