Skip to content

Commit f0d799c

Browse files
winebarrelCopilot
andauthored
Update dgw.go
Co-authored-by: Copilot <[email protected]>
1 parent 850faa6 commit f0d799c

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

dgw.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -426,7 +426,10 @@ func PgCreateStruct(
426426
src = append(src, m...)
427427
}
428428
}
429-
// WORKAROUND: Fix for `format.Source()` bug
429+
// WORKAROUND: `format.Source()` strips empty comments (e.g., lines with only `//`), which can break code generation
430+
// See Go issue https://github.com/golang/go/issues/54489 for details.
431+
// This workaround replaces the placeholder `// %EMPTY_COMMENT%` with a bare comment after formatting.
432+
// Remove this workaround once `format.Source()` preserves empty comments in a future Go release.
430433
src = bytes.ReplaceAll(src, []byte("// %EMPTY_COMMENT%"), []byte("//"))
431434
return src, nil
432435
}

0 commit comments

Comments
 (0)