You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

29 lines
616 B

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