structs.go 924 B

1234567891011121314151617181920212223242526
  1. // Copyright GoFrame Author(https://goframe.org). All Rights Reserved.
  2. //
  3. // This Source Code Form is subject to the terms of the MIT License.
  4. // If a copy of the MIT was not distributed with this file,
  5. // You can obtain one at https://github.com/gogf/gf.
  6. // Package structs provides functions for struct information retrieving and struct conversion.
  7. //
  8. // Inspired and improved from: https://github.com/fatih/structs
  9. package structs
  10. import (
  11. "reflect"
  12. )
  13. // Type wraps reflect.Type for additional features.
  14. type Type struct {
  15. reflect.Type
  16. }
  17. // Field contains information of a struct field .
  18. type Field struct {
  19. Value reflect.Value // The underlying value of the field.
  20. Field reflect.StructField // The underlying field of the field.
  21. TagValue string // Retrieved tag value. There might be more than one tags in the field, but only one can be retrieved according to calling function rules.
  22. }