Use more idiomatic Go instead of CheckError.