Symphilosophein 狂者進取,狷者有所不為也。
func Copy(s string) string { var b []byte h := (*reflect.SliceHeader)(unsafe.Pointer(&b)) h.Data = (*reflect.StringHeader)(unsafe.Pointer(&s)).Data h.Len = len(s) h.Cap = len(s) return string(b) }
Note: Only a member of this blog may post a comment.
No comments:
Post a Comment
Note: Only a member of this blog may post a comment.