xref: /aosp_15_r20/external/golang-protobuf/internal/strs/strings_pure.go (revision 1c12ee1efe575feb122dbf939ff15148a3b3e8f2)
1// Copyright 2018 The Go Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style
3// license that can be found in the LICENSE file.
4
5//go:build purego || appengine
6// +build purego appengine
7
8package strs
9
10import pref "google.golang.org/protobuf/reflect/protoreflect"
11
12func UnsafeString(b []byte) string {
13	return string(b)
14}
15
16func UnsafeBytes(s string) []byte {
17	return []byte(s)
18}
19
20type Builder struct{}
21
22func (*Builder) AppendFullName(prefix pref.FullName, name pref.Name) pref.FullName {
23	return prefix.Append(name)
24}
25
26func (*Builder) MakeString(b []byte) string {
27	return string(b)
28}
29