strings_pure.go 585 B

123456789101112131415161718192021222324252627
  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. // +build purego appengine
  5. package strs
  6. import pref "google.golang.org/protobuf/reflect/protoreflect"
  7. func UnsafeString(b []byte) string {
  8. return string(b)
  9. }
  10. func UnsafeBytes(s string) []byte {
  11. return []byte(s)
  12. }
  13. type Builder struct{}
  14. func (*Builder) AppendFullName(prefix pref.FullName, name pref.Name) pref.FullName {
  15. return prefix.Append(name)
  16. }
  17. func (*Builder) MakeString(b []byte) string {
  18. return string(b)
  19. }