News for hackers. Stuff that matters.
Re:Go 1.20 Released by jacksgt on Wednesday February 01, 2023 @04:01PM (#34617679)
> Go 1.20 supports collecting code coverage profiles for programs (applications and integration tests), as opposed to just unit tests. > To collect coverage data for a program, build it with go build's -cover flag,

This is absolutely awesome! I'm looking forward to trying this on some server binaries!

Re:Go 1.20 Released by alexott on Wednesday February 01, 2023 @04:17PM (#34617896)
Im struggling with previous behavior all the time. It would be much better with this
Re:Go 1.20 Released by froh on Wednesday February 01, 2023 @05:23PM (#34618831)
yay now we can combine and balance mc/dc coverage testing with fuzzing. I find SQLite verification inspiring in that regard: https://www.sqlite.org/testing.html#tension_between_fuzz_tes...
Re:Go 1.20 Released by thiht on Thursday February 02, 2023 @03:45AM (#34623909)
Note that it was already possible before with a command like:

    go test -coverpkg=./... -c . -o main.test
This command builds a test binary with a coverage config. So if you run it, launch your tests, and stop it gracefully, it will spit out a coverage report.

I’m not exactly sure what the change in Go 1.20 is about, maybe it’s easier somehow, I’ll have to try it.

Re:Go 1.20 Released by majewsky on Thursday February 02, 2023 @05:05PM (#34633859)
That's not the same. `go test -c` builds a binary that runs your tests, whereas (if I understand correctly) the new thing builds a binary that runs your main(). If it works as I understand, that would be fantastic because then I could get rid of this monstrosity: https://github.com/holocm/holo/blob/master/main_test.go