nameFromSnakeCase converts snake_case to CamelCase.
(s string)
| 471 | |
| 472 | // nameFromSnakeCase converts snake_case to CamelCase. |
| 473 | func nameFromSnakeCase(s string) string { |
| 474 | var ret string |
| 475 | for _, ss := range strings.Split(s, "_") { |
| 476 | switch ss { |
| 477 | case "id": |
| 478 | ret += "ID" |
| 479 | case "ids": |
| 480 | ret += "IDs" |
| 481 | case "jwt": |
| 482 | ret += "JWT" |
| 483 | case "idx": |
| 484 | ret += "Index" |
| 485 | case "api": |
| 486 | ret += "API" |
| 487 | case "uuid": |
| 488 | ret += "UUID" |
| 489 | case "gitsshkeys": |
| 490 | ret += "GitSSHKeys" |
| 491 | case "fkey": |
| 492 | // ignore |
| 493 | default: |
| 494 | ret += strings.Title(ss) |
| 495 | } |
| 496 | } |
| 497 | return ret |
| 498 | } |
| 499 | |
| 500 | // interfaceMethods returns all embedded methods of an interface. |
| 501 | func interfaceMethods(i *dst.InterfaceType) []*dst.Field { |
no outgoing calls
no test coverage detected