Skip to content

Commit 67fe227

Browse files
stephentoubCopilot
andcommitted
fix: regenerate Go output with gofmt for proper formatting
Removed manual quicktype column-alignment workaround and regenerated with Go installed locally so formatGoFile() runs gofmt properly. This ensures the committed output exactly matches what CI produces. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 1345015 commit 67fe227

2 files changed

Lines changed: 24 additions & 29 deletions

File tree

go/rpc/generated_rpc.go

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -292,16 +292,16 @@ type SessionToolsHandlePendingToolCallResult struct {
292292
}
293293

294294
type SessionToolsHandlePendingToolCallParams struct {
295-
Error *string `json:"error,omitempty"`
296-
RequestID string `json:"requestId"`
297-
Result *ResultUnion `json:"result"`
295+
Error *string `json:"error,omitempty"`
296+
RequestID string `json:"requestId"`
297+
Result *ResultUnion `json:"result"`
298298
}
299299

300300
type ResultResult struct {
301-
Error *string `json:"error,omitempty"`
302-
ResultType *string `json:"resultType,omitempty"`
303-
TextResultForLlm string `json:"textResultForLlm"`
304-
ToolTelemetry map[string]interface{} `json:"toolTelemetry,omitempty"`
301+
Error *string `json:"error,omitempty"`
302+
ResultType *string `json:"resultType,omitempty"`
303+
TextResultForLlm string `json:"textResultForLlm"`
304+
ToolTelemetry map[string]interface{} `json:"toolTelemetry,omitempty"`
305305
}
306306

307307
type SessionPermissionsHandlePendingPermissionRequestResult struct {
@@ -310,16 +310,16 @@ type SessionPermissionsHandlePendingPermissionRequestResult struct {
310310
}
311311

312312
type SessionPermissionsHandlePendingPermissionRequestParams struct {
313-
RequestID string `json:"requestId"`
314-
Result SessionPermissionsHandlePendingPermissionRequestParamsResult `json:"result"`
313+
RequestID string `json:"requestId"`
314+
Result SessionPermissionsHandlePendingPermissionRequestParamsResult `json:"result"`
315315
}
316316

317317
type SessionPermissionsHandlePendingPermissionRequestParamsResult struct {
318-
Kind Kind `json:"kind"`
319-
Rules []interface{} `json:"rules,omitempty"`
320-
Feedback *string `json:"feedback,omitempty"`
321-
Message *string `json:"message,omitempty"`
322-
Path *string `json:"path,omitempty"`
318+
Kind Kind `json:"kind"`
319+
Rules []interface{} `json:"rules,omitempty"`
320+
Feedback *string `json:"feedback,omitempty"`
321+
Message *string `json:"message,omitempty"`
322+
Path *string `json:"path,omitempty"`
323323
}
324324

325325
type SessionLogResult struct {
@@ -371,18 +371,18 @@ type SessionShellKillParams struct {
371371
type Mode string
372372

373373
const (
374-
Autopilot Mode = "autopilot"
374+
Autopilot Mode = "autopilot"
375375
Interactive Mode = "interactive"
376-
Plan Mode = "plan"
376+
Plan Mode = "plan"
377377
)
378378

379379
type Kind string
380380

381381
const (
382-
Approved Kind = "approved"
383-
DeniedByContentExclusionPolicy Kind = "denied-by-content-exclusion-policy"
384-
DeniedByRules Kind = "denied-by-rules"
385-
DeniedInteractivelyByUser Kind = "denied-interactively-by-user"
382+
Approved Kind = "approved"
383+
DeniedByContentExclusionPolicy Kind = "denied-by-content-exclusion-policy"
384+
DeniedByRules Kind = "denied-by-rules"
385+
DeniedInteractivelyByUser Kind = "denied-interactively-by-user"
386386
DeniedNoApprovalRuleAndCouldNotRequestFromUser Kind = "denied-no-approval-rule-and-could-not-request-from-user"
387387
)
388388

@@ -391,23 +391,23 @@ const (
391391
type Level string
392392

393393
const (
394-
Error Level = "error"
395-
Info Level = "info"
394+
Error Level = "error"
395+
Info Level = "info"
396396
Warning Level = "warning"
397397
)
398398

399399
// Signal to send (default: SIGTERM)
400400
type Signal string
401401

402402
const (
403-
Sigint Signal = "SIGINT"
403+
Sigint Signal = "SIGINT"
404404
Sigkill Signal = "SIGKILL"
405405
Sigterm Signal = "SIGTERM"
406406
)
407407

408408
type ResultUnion struct {
409409
ResultResult *ResultResult
410-
String *string
410+
String *string
411411
}
412412

413413
type ServerModelsRpcApi struct {

scripts/codegen/go.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -182,11 +182,6 @@ async function generateRpc(schemaPath?: string): Promise<void> {
182182
let qtCode = qtResult.lines.filter((l) => !l.startsWith("package ")).join("\n");
183183
// Strip trailing whitespace from quicktype output (gofmt requirement)
184184
qtCode = qtCode.replace(/[ \t]+$/gm, "");
185-
// Collapse quicktype's column-aligned struct fields to single-space separation.
186-
// gofmt doesn't column-align fields that have comments between them, so the wide
187-
// padding quicktype emits causes a gofmt diff. Apply to all capitalized field lines
188-
// (only in quicktype output — hand-written code is emitted separately).
189-
qtCode = qtCode.replace(/^(\t[A-Z].*)/gm, (_, line) => line.replace(/ +/g, " "));
190185
for (const typeName of experimentalTypeNames) {
191186
qtCode = qtCode.replace(
192187
new RegExp(`^(type ${typeName} struct)`, "m"),

0 commit comments

Comments
 (0)