(x *ast.Ident)
| 350 | } |
| 351 | |
| 352 | func zeroValueOfIdent(x *ast.Ident) string { |
| 353 | switch x.String() { |
| 354 | case "int", "int64", "float64", "uint8", "uint16": |
| 355 | return "0" |
| 356 | case "string": |
| 357 | return `""` |
| 358 | case "bool": |
| 359 | return "false" |
| 360 | case "Timestamp": |
| 361 | return "Timestamp{}" |
| 362 | default: |
| 363 | return "nil" |
| 364 | } |
| 365 | } |
| 366 | |
| 367 | func genIdentGetter(x *ast.Ident, receiverType, fieldName string) *getter { |
| 368 | zeroValue := zeroValueOfIdent(x) |
no test coverage detected
searching dependent graphs…