256
|
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 |
|
260
|
5 |
//go:build purego || appengine |
256
|
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 |
} |