(value reflect.Value, fieldName string)
| 935 | } |
| 936 | |
| 937 | func configNodeFromValue(value reflect.Value, fieldName string) (any, bool) { |
| 938 | value, ok := indirectConfigValue(value) |
| 939 | if !ok { |
| 940 | return nil, false |
| 941 | } |
| 942 | if value.Type() == configDurationType { |
| 943 | return time.Duration(value.Int()).String(), true |
| 944 | } |
| 945 | switch value.Kind() { |
| 946 | case reflect.Struct: |
| 947 | return configStructNode(value) |
| 948 | case reflect.Map: |
| 949 | return configMapNode(value, fieldName) |
| 950 | case reflect.Slice, reflect.Array: |
| 951 | return configSequenceNode(value, fieldName) |
| 952 | default: |
| 953 | return configScalarNode(value) |
| 954 | } |
| 955 | } |
| 956 | |
| 957 | func indirectConfigValue(value reflect.Value) (reflect.Value, bool) { |
| 958 | if !value.IsValid() { |
no test coverage detected