mirror of
https://github.com/VictoriaMetrics/VictoriaMetrics.git
synced 2024-11-21 14:44:00 +00:00
60c7397be5
Such placeholders are substituted by the corresponding environment variable values. Updates https://github.com/VictoriaMetrics/VictoriaMetrics/issues/583
21 lines
375 B
Go
21 lines
375 B
Go
// +build !appengine
|
|
|
|
package fasttemplate
|
|
|
|
import (
|
|
"reflect"
|
|
"unsafe"
|
|
)
|
|
|
|
func unsafeBytes2String(b []byte) string {
|
|
return *(*string)(unsafe.Pointer(&b))
|
|
}
|
|
|
|
func unsafeString2Bytes(s string) (b []byte) {
|
|
sh := (*reflect.StringHeader)(unsafe.Pointer(&s))
|
|
bh := (*reflect.SliceHeader)(unsafe.Pointer(&b))
|
|
bh.Data = sh.Data
|
|
bh.Cap = sh.Len
|
|
bh.Len = sh.Len
|
|
return b
|
|
}
|