mirror of
https://github.com/criyle/go-judge.git
synced 2025-09-26 22:39:12 +08:00
12 lines
207 B
Go
12 lines
207 B
Go
package main
|
|
|
|
import "unsafe"
|
|
|
|
func strToBytes(s string) []byte {
|
|
return unsafe.Slice(unsafe.StringData(s), len(s))
|
|
}
|
|
|
|
func byteArrayToString(buf []byte) string {
|
|
return *(*string)(unsafe.Pointer(&buf))
|
|
}
|