stubs_go120.go 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. //go:build !go1.21
  2. // +build !go1.21
  3. /*
  4. * Copyright 2021 ByteDance Inc.
  5. *
  6. * Licensed under the Apache License, Version 2.0 (the "License");
  7. * you may not use this file except in compliance with the License.
  8. * You may obtain a copy of the License at
  9. *
  10. * http://www.apache.org/licenses/LICENSE-2.0
  11. *
  12. * Unless required by applicable law or agreed to in writing, software
  13. * distributed under the License is distributed on an "AS IS" BASIS,
  14. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  15. * See the License for the specific language governing permissions and
  16. * limitations under the License.
  17. */
  18. package resolver
  19. import (
  20. _ `encoding/json`
  21. `reflect`
  22. _ `unsafe`
  23. )
  24. type StdField struct {
  25. name string
  26. nameBytes []byte
  27. equalFold func()
  28. nameNonEsc string
  29. nameEscHTML string
  30. tag bool
  31. index []int
  32. typ reflect.Type
  33. omitEmpty bool
  34. quoted bool
  35. encoder func()
  36. }
  37. type StdStructFields struct {
  38. list []StdField
  39. nameIndex map[string]int
  40. }
  41. //go:noescape
  42. //go:linkname typeFields encoding/json.typeFields
  43. func typeFields(_ reflect.Type) StdStructFields
  44. func handleOmitZero(f StdField, fv *FieldMeta) {}