News for hackers. Stuff that matters.
Re:Profiling Go Applications with Flamegraphs by Buge on Sunday March 11, 2018 @11:52PM (#16566100)
Does anyone else have this problem with go indentation:

    func (sc *SimpleClient) Timing(s string, d time.Duration, sampleRate float64,
        tags map[string]string) error {
        return sc.send([...]
The wrapped parameter list is indented to the same level as the function body. Is this how it's supposed to be done?
Re:Profiling Go Applications with Flamegraphs by flashmob on Monday March 12, 2018 @12:39AM (#16566248)
No problem with that indenting here (personal opinion), I guess makes it easier to read if your editor doesn't have soft-wraps. However, generally, if the parameters list overflow to another line like that, it becomes a good candidate for refactoring!
Re:Profiling Go Applications with Flamegraphs by farnsworthy on Monday March 12, 2018 @03:38AM (#16566683)
Yeah, it could be a new struct, especially if another parameter or two comes along (though the simplest thing has its benefits, too).
Re:Profiling Go Applications with Flamegraphs by dilap on Monday March 12, 2018 @12:24AM (#16566203)
Surprisingly, it is. (Though personally in Go I wouldn't wrap the parameter list at all (and I think maybe most also doesn't?). Then you just let your editor soft-wrap to match current window width; the continued line indent can be configured per personal taste.)