News for hackers. Stuff that matters.
Re:A Rust Contributor Tries Their Hand at Go by NateDad on Tuesday April 28, 2015 @11:43PM (#9456380)
Just a copy and paste from the solution I posted elsewhere... this really shouldn't be too hard to work around:

You can easily make a wrapper type that simply masks the underlying Next() method with its own implementation.

    type MyType struct {}
    func (m *MyType) Next(i int) {
        // do base next stuff
    }

    type ForSql struct {
        *MyType
    }
    func (f ForSql) Next() bool {
        // do sql-next stuff
    }
and then using this type is trivial in-code:

    mt := &MyType{}
    doSomeSqlThing(ForSql{mt})
Note that this new type retains all the methods of the original type, so it still implements all the interfaces it used to (unless they rely on the old Next signature).

There are no comments on this comment yet.