(propNames: string[])
| 1517 | } |
| 1518 | |
| 1519 | function goJSONRawStructFields(propNames: string[]): Map<string, string> { |
| 1520 | const fieldNames = new Map<string, string>(); |
| 1521 | const used = new Set<string>(); |
| 1522 | for (const propName of [...new Set(propNames)].sort()) { |
| 1523 | const baseName = toGoFieldName(propName) || "Field"; |
| 1524 | let fieldName = baseName; |
| 1525 | let suffix = 2; |
| 1526 | while (used.has(fieldName)) { |
| 1527 | fieldName = `${baseName}${suffix++}`; |
| 1528 | } |
| 1529 | used.add(fieldName); |
| 1530 | fieldNames.set(propName, fieldName); |
| 1531 | } |
| 1532 | return fieldNames; |
| 1533 | } |
| 1534 | |
| 1535 | function pushGoJSONRawStructDeclLines( |
| 1536 | lines: string[], |
no test coverage detected
searching dependent graphs…