f simply calls fn with w. This uses the special "line" pragma to set the file and line number to be something consistent. It must be declared last in the file to prevent "line" from affecting the line numbers of anything else in this file.
(fn func(...any), w wrapError)
| 255 | // something consistent. It must be declared last in the file to prevent "line" |
| 256 | // from affecting the line numbers of anything else in this file. |
| 257 | func f(fn func(...any), w wrapError) { |
| 258 | //line try.go:1 |
| 259 | fn(w) |
| 260 | } |