I notice you're consistently using a switch statement in these cases, even though there's only one case (well two if you count the error condition). Is this idiomatic Go?