mirror of
https://github.com/go-gitea/gitea
synced 2025-07-06 18:47:19 +00:00
Update Goldmark v1.1.25 -> v1.1.32 (#12048)
This commit is contained in:
9
vendor/github.com/yuin/goldmark/util/util_unsafe.go
generated
vendored
9
vendor/github.com/yuin/goldmark/util/util_unsafe.go
generated
vendored
@ -13,8 +13,11 @@ func BytesToReadOnlyString(b []byte) string {
|
||||
}
|
||||
|
||||
// StringToReadOnlyBytes returns bytes converted from given string.
|
||||
func StringToReadOnlyBytes(s string) []byte {
|
||||
func StringToReadOnlyBytes(s string) (bs []byte) {
|
||||
sh := (*reflect.StringHeader)(unsafe.Pointer(&s))
|
||||
bh := reflect.SliceHeader{Data: sh.Data, Len: sh.Len, Cap: sh.Len}
|
||||
return *(*[]byte)(unsafe.Pointer(&bh))
|
||||
bh := (*reflect.SliceHeader)(unsafe.Pointer(&bs))
|
||||
bh.Data = sh.Data
|
||||
bh.Cap = sh.Len
|
||||
bh.Len = sh.Len
|
||||
return
|
||||
}
|
||||
|
Reference in New Issue
Block a user