better error handling.

fmt.Fprintf would look much more natural here.