We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 850faa6 commit f0d799cCopy full SHA for f0d799c
dgw.go
@@ -426,7 +426,10 @@ func PgCreateStruct(
426
src = append(src, m...)
427
}
428
429
- // WORKAROUND: Fix for `format.Source()` bug
+ // 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.
433
src = bytes.ReplaceAll(src, []byte("// %EMPTY_COMMENT%"), []byte("//"))
434
return src, nil
435
0 commit comments