(structType reflect.Type, typeStructField string)
| 1222 | } |
| 1223 | |
| 1224 | func inferPromptFieldName(structType reflect.Type, typeStructField string) string { |
| 1225 | field, _ := structType.Elem().FieldByName(typeStructField) |
| 1226 | tag, ok := getTagFieldName(field) |
| 1227 | if ok { |
| 1228 | return tag |
| 1229 | } |
| 1230 | return typeStructField |
| 1231 | } |
| 1232 | |
| 1233 | func getTagFieldName(field reflect.StructField) (string, bool) { |
| 1234 | tag, ok := field.Tag.Lookup("json") |
no test coverage detected