News for hackers. Stuff that matters.
Re:Introducing HTTP Tracing by Zikes on Wednesday October 05, 2016 @12:21AM (#12641533)
If you remove the err assignment the compiler will also complain about a value assignment mismatch:

https://play.golang.org/p/UBL0MZtscc

> tmp/sandbox307381845/main.go:8: multiple-value "html/template".New("foo").Parse() in single-value context

You would have to explicitly assign the err return value to underscore in order to ignore it.

Re:Introducing HTTP Tracing by cderwin on Wednesday October 05, 2016 @01:24AM (#12641724)
hueving is correct, I meant something like this[1]. Of course, something like this[2] also works.

[1] https://play.golang.org/p/igdUx6qckf

[2] https://play.golang.org/p/_JW5QE_zOJ

Re:Introducing HTTP Tracing by Zikes on Wednesday October 05, 2016 @12:54PM (#12645567)
That function does not have side effects, so it would be pointless to remove the assignment altogether.

Assigning errors to underscore is effectively the same as try { myFunc(); } except { pass; }, making them equivalent.

Re:Introducing HTTP Tracing by hueving on Wednesday October 05, 2016 @01:18AM (#12641700)
No, remove the entire assignment.