khenaidoo | 5fc5cea | 2021-08-11 17:39:16 -0400 | [diff] [blame] | 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 | |
Joey Armstrong | ba3d9d1 | 2024-01-15 14:22:11 -0500 | [diff] [blame] | 5 | //go:build purego || appengine |
khenaidoo | 5fc5cea | 2021-08-11 17:39:16 -0400 | [diff] [blame] | 6 | // +build purego appengine |
| 7 | |
| 8 | package strs |
| 9 | |
| 10 | import pref "google.golang.org/protobuf/reflect/protoreflect" |
| 11 | |
| 12 | func UnsafeString(b []byte) string { |
| 13 | return string(b) |
| 14 | } |
| 15 | |
| 16 | func UnsafeBytes(s string) []byte { |
| 17 | return []byte(s) |
| 18 | } |
| 19 | |
| 20 | type Builder struct{} |
| 21 | |
| 22 | func (*Builder) AppendFullName(prefix pref.FullName, name pref.Name) pref.FullName { |
| 23 | return prefix.Append(name) |
| 24 | } |
| 25 | |
| 26 | func (*Builder) MakeString(b []byte) string { |
| 27 | return string(b) |
| 28 | } |