News for hackers. Stuff that matters.
Re:Web.go – Web applications with Go by groks on Tuesday November 12, 2013 @12:16PM (#6719118)
You could create a dummy interface which all your DoParams-like types could implement:

    type Params interface { IsParams() }
Also, you can get away with passing a nil pointer for reflection rather than allocating a nil struct:

    fmt.Printf("nil pointer to DoParams: %T", (*DoParams)(nil))
    fmt.Printf("pointer to nil DoParams: %T", &DoParams{})
(Which isn't going to be a source of gc pressure in this instance, but still...)

There are no comments on this comment yet.