3 ms·
Yeah, that would work, though then I need to worry about all the local variables too (which I didn't use in the example but did need in the actual code). Still,
by Manishearth 12y ago
Yeah, that would work, though then I need to worry about all the local variables too (which I didn't use in the example but did need in the actual code). Still, not a major overhead since I can use a context object for that. Anyway, my issue was with the vtable dispatch of interfaces more than with type switches -- using a .Draw method is pretty much the same :)
But yes. It was written with Rust intuition, and whilst I ried to learn the Go way of doing things, I obviously didn't pick up everything :P
Thanks though; I'll try to use this pattern in the future!