Documentation
¶
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BytesToStr ¶
BytesToStr It doesn't copy the data, so it's more quickly.
Example ¶
package main
import (
"fmt"
"github.com/CarsonSlovoka/go-pkg/v2/unsafe"
)
func main() {
var s string
s = unsafe.BytesToStr([]byte("hello"))
fmt.Println(s)
}
Output: hello
func StrToBytes ¶
StrToBytes It doesn't copy the data, so it's more quickly.
Example ¶
package main
import (
"fmt"
"github.com/CarsonSlovoka/go-pkg/v2/unsafe"
)
func main() {
var bs []byte
bs = unsafe.StrToBytes("hello")
fmt.Printf("%v", bs)
}
Output: [104 101 108 108 111]
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.