Squashed 'backend/goldmark/' content from commit 379bf24

git-subtree-dir: backend/goldmark
git-subtree-split: 379bf24a47e6ef07f34d7536aead86d8792ac300
This commit is contained in:
2026-05-24 09:40:13 +02:00
commit ad273dbe5d
109 changed files with 54777 additions and 0 deletions
+18
View File
@@ -0,0 +1,18 @@
//go:build !appengine && !js && go1.21
// +build !appengine,!js,go1.21
package util
import (
"unsafe"
)
// BytesToReadOnlyString returns a string converted from given bytes.
func BytesToReadOnlyString(b []byte) string {
return unsafe.String(unsafe.SliceData(b), len(b))
}
// StringToReadOnlyBytes returns bytes converted from given string.
func StringToReadOnlyBytes(s string) []byte {
return unsafe.Slice(unsafe.StringData(s), len(s))
}