updateHeader modifies the header of the given file to be JSON-RPC specific.
(f *codegen.File)
| 66 | |
| 67 | // updateHeader modifies the header of the given file to be JSON-RPC specific. |
| 68 | func updateHeader(f *codegen.File) { |
| 69 | // Update the title |
| 70 | header := f.SectionTemplates[0] |
| 71 | title := strings.Replace(header.Data.(map[string]any)["Title"].(string), "HTTP", "JSON-RPC", 1) |
| 72 | header.Data.(map[string]any)["Title"] = title |
| 73 | |
| 74 | // Update the imports |
| 75 | imports := header.Data.(map[string]any)["Imports"].([]*codegen.ImportSpec) |
| 76 | for _, i := range imports { |
| 77 | i.Path = strings.Replace(i.Path, "gen/http", "gen/jsonrpc", 1) |
| 78 | } |
| 79 | } |
no outgoing calls
no test coverage detected