Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Message from discussion Any alternative error handling / reporting?

Date: Thu, 10 May 2012 16:58:15 -0700 (PDT)
From: lamvak <lam...@gmail.com>
To: golang-nuts@googlegroups.com
Message-ID: <11850855.353.1336694295394.JavaMail.geo-discussion-forums@vbbgl4>
Subject: Any alternative error handling / reporting?
MIME-Version: 1.0
Content-Type: multipart/mixed; 
	boundary="----=_Part_351_25715191.1336694295393"

------=_Part_351_25715191.1336694295393
Content-Type: multipart/alternative; 
	boundary="----=_Part_352_14132491.1336694295393"

------=_Part_352_14132491.1336694295393
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit

Hi!
My head starts to spin when I read my own code, for the amount of
if err != nil {
    return nil, err
}
Is there no neat alternative? Program should panic only when there is a 
reason to panic - when programmer doesn't know how to continue computation 
(or at least that I got from the documentation).
Well, that idiom is what I know I can do for the most of the time: clean 
non garbage collected memory (mmaps) and return an error indication. But 
can't it be anything different that this?

------=_Part_352_14132491.1336694295393
Content-Type: text/html; charset=utf-8
Content-Transfer-Encoding: 7bit

Hi!<div>My head starts to spin when I read my own code, for the amount of</div><div>if err != nil {</div><div>&nbsp; &nbsp; return nil, err</div><div>}</div><div>Is there no neat alternative? Program should panic only when there is a reason to panic - when programmer doesn't know how to continue computation (or at least that I got from the documentation).</div><div>Well, that idiom is what I know I can do for the most of the time: clean non garbage collected memory (mmaps) and return an error indication. But can't it be anything different that this?</div>
------=_Part_352_14132491.1336694295393--

------=_Part_351_25715191.1336694295393--