Skip to content

Commit

Permalink
cmd/goimports: fix -trace flag: flush after stopping trace
Browse files Browse the repository at this point in the history
Without this change, the created trace files cannot be read by "go tool trace":

2023/12/25 09:51:02 Parsing trace...
failed to parse trace: no EvFrequency event

Change-Id: I59964875c8e821262db2cc6bbc82b2be385e1618
Reviewed-on: https://go-review.googlesource.com/c/tools/+/553555
Reviewed-by: Robert Findley <[email protected]>
Auto-Submit: Michael Stapelberg <[email protected]>
LUCI-TryBot-Result: Go LUCI <[email protected]>
  • Loading branch information
stapelberg authored and gopherbot committed Jan 3, 2024
1 parent 5e6f314 commit a863a4f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion cmd/goimports/goimports_gc.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ func doTrace() func() {
bw, flush := bufferedFileWriter(*traceProfile)
trace.Start(bw)
return func() {
flush()
trace.Stop()
flush()
}
}
return func() {}
Expand Down

0 comments on commit a863a4f

Please sign in to comment.