normalizeWarnings converts provider call warnings into their normalized form. Returns nil for empty input to keep JSON clean.
(warnings []fantasy.CallWarning)
| 1174 | // normalizeWarnings converts provider call warnings into their |
| 1175 | // normalized form. Returns nil for empty input to keep JSON clean. |
| 1176 | func normalizeWarnings(warnings []fantasy.CallWarning) []normalizedWarning { |
| 1177 | if len(warnings) == 0 { |
| 1178 | return nil |
| 1179 | } |
| 1180 | result := make([]normalizedWarning, 0, len(warnings)) |
| 1181 | for _, w := range warnings { |
| 1182 | result = append(result, normalizedWarning{ |
| 1183 | Type: string(w.Type), |
| 1184 | Setting: w.Setting, |
| 1185 | Details: w.Details, |
| 1186 | Message: w.Message, |
| 1187 | }) |
| 1188 | } |
| 1189 | return result |
| 1190 | } |
| 1191 | |
| 1192 | // --------------- normalize functions --------------- |
| 1193 |
no outgoing calls
no test coverage detected