Skip to content

Commit c2f41e1

Browse files
committed
Improve internal comments about srcFinal, srcFilename
1 parent 5f57538 commit c2f41e1

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

main.go

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -466,9 +466,14 @@ func _main() error {
466466
src.WriteString("\n}\n")
467467

468468
var (
469+
// srcFinal is the final transformed source after goimports.
470+
// When in module mode AND dumping (-E, -Eplay) or sending to the Playground (-play, -share),
471+
// this is not just the Go code, but a Txtar archive that includes go.mod and go.sum.
472+
srcFinal io.Writer
473+
// srcFilename is the full path to the srcFinal on disk that is needed by goimports to locate go.mod.
469474
srcFilename string
470-
srcFinal io.Writer // The final transformed source after goimports. Txtar format if in Go modules mode.
471-
tail func() error
475+
// tail is the action that will process srcFinal.
476+
tail func() error
472477
)
473478
switch action {
474479
case actionRun, actionBuild:

0 commit comments

Comments
 (0)