Repository: google/pprof
Pull request #665 (2021-11-03 22:48:46)

Avoid adding a redundant newline when printing weblistPageClosing
weblistPageClosing string ends in a new line, so printing it via fmt.Println will add an extra new line.

aalexand: > Could you elaborate why is this change needed? What's wrong with Println?

If this is to avoid a redundant newline, then I think it's easier to update the value of the weblistPageClosing var to remove it there and leave the code as is.

And also the PR description needs to be updated I think. I don't think this change has anything to do with the linked 'go vet' changes. Those changes are about format strings for Printf.
zpavlinovic: > > Could you elaborate why is this change needed? What's wrong with Println?
> 
> If this is to avoid a redundant newline, then I think it's easier to update the value of the weblistPageClosing var to remove it there and leave the code as is.

Sounds good.

> And also the PR description needs to be updated I think. I don't think this change has anything to do with the linked 'go vet' changes. Those changes are about format strings for Printf.

Yes, it is about avoiding a redundant new line. The reason I mentioned vet is because a previous [limitation](https://github.com/golang/go/issues/30436) has been recently addressed. I will change the description.
aalexand: The description still mentions "go vet".
zpavlinovic: > The description still mentions "go vet".

Hopefully, I have corrected it at all the relevant places now.
codecov-commenter: # [Codecov](https://codecov.io/gh/google/pprof/pull/665?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=google) Report
> Merging [#665](https://codecov.io/gh/google/pprof/pull/665?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=google) (0b0dd28) into [master](https://codecov.io/gh/google/pprof/commit/f410f490c7b684609546e168a4e241fed33171b5?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=google) (f410f49) will **not change** coverage.
> The diff coverage is `n/a`.

[![Impacted file tree graph](https://codecov.io/gh/google/pprof/pull/665/graphs/tree.svg?width=650&height=150&src=pr&token=nHgs4Smibv&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=google)](https://codecov.io/gh/google/pprof/pull/665?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=google)

```diff
@@           Coverage Diff           @@
##           master     #665   +/-   ##
=======================================
  Coverage   68.19%   68.19%           
=======================================
  Files          41       41           
  Lines        7391     7391           
=======================================
  Hits         5040     5040           
  Misses       1910     1910           
  Partials      441      441           
```



------

[Continue to review full report at Codecov](https://codecov.io/gh/google/pprof/pull/665?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=google).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=google)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/google/pprof/pull/665?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=google). Last update [f410f49...0b0dd28](https://codecov.io/gh/google/pprof/pull/665?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=google). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=google).


Patch:
diff --git a/internal/report/source_html.go b/internal/report/source_html.go
index 17c9f6e..851693f 100644
--- a/internal/report/source_html.go
+++ b/internal/report/source_html.go
@@ -72,5 +72,4 @@ function pprof_toggle_asm(e) {
 
 const weblistPageClosing = `
 </body>
-</html>
-`
+</html>`


Test patch:
diff --git a/internal/driver/testdata/pprof.cpu.flat.addresses.weblist b/internal/driver/testdata/pprof.cpu.flat.addresses.weblist
index 2eb6b7d..d8446c8 100644
--- a/internal/driver/testdata/pprof.cpu.flat.addresses.weblist
+++ b/internal/driver/testdata/pprof.cpu.flat.addresses.weblist
@@ -99,4 +99,3 @@ Duration: 10s, Total samples = 1.12s (11.20%)<br>Total: 1.12s</div><h2>line1000<
 
 </body>
 </html>
-