stubs_go123.go 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. //go:build go1.21 && !go1.24
  2. // +build go1.21,!go1.24
  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. nameNonEsc string
  28. nameEscHTML string
  29. tag bool
  30. index []int
  31. typ reflect.Type
  32. omitEmpty bool
  33. quoted bool
  34. encoder func()
  35. }
  36. type StdStructFields struct {
  37. list []StdField
  38. nameIndex map[string]*StdField
  39. byFoldedName map[string]*StdField
  40. }
  41. //go:noescape
  42. //go:linkname typeFields encoding/json.typeFields
  43. func typeFields(_ reflect.Type) StdStructFields
  44. func handleOmitZero(f StdField, fv *FieldMeta) {}