(
lines: string[],
rawExpr: string,
structVar: string,
propNames: string[],
indent: string
)
| 1548 | } |
| 1549 | |
| 1550 | function pushGoJSONRawStructUnmarshalLines( |
| 1551 | lines: string[], |
| 1552 | rawExpr: string, |
| 1553 | structVar: string, |
| 1554 | propNames: string[], |
| 1555 | indent: string |
| 1556 | ): Map<string, string> { |
| 1557 | const fieldNames = pushGoJSONRawStructDeclLines(lines, structVar, propNames, indent); |
| 1558 | lines.push(`${indent}if err := json.Unmarshal(${rawExpr}, &${structVar}); err != nil {`); |
| 1559 | lines.push(`${indent}\treturn false`); |
| 1560 | lines.push(`${indent}}`); |
| 1561 | return fieldNames; |
| 1562 | } |
| 1563 | |
| 1564 | function goJSONPathVarName(varPrefix: string, path: string[]): string { |
| 1565 | return `${varPrefix}${path.map(toGoFieldName).join("")}`; |
no test coverage detected
searching dependent graphs…