Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(100)

Issue 110040044: go.tools/go/loader: Don't print errors, only collect them.

Can't Edit
Can't Publish+Mail
Start Review
Created:
11 years, 6 months ago by gmk
Modified:
11 years, 6 months ago
Reviewers:
gri, adonovan
CC:
golang-codereviews
Visibility:
Public.

Description

go.tools/go/loader: Don't print errors, only collect them.

Patch Set 1 #

Patch Set 2 : code review 110040044: go.tools/go/loader: Don't print errors, only collect them. #

Patch Set 3 : diff -r 93422c3d1033 https://code.google.com/p/go.tools #

Unified diffs Side-by-side diffs Delta from patch set Stats (+7 lines, -9 lines) Patch
M go/loader/loader.go View 1 2 2 chunks +7 lines, -9 lines 0 comments Download

Messages

Total messages: 5
gmk
11 years, 6 months ago (2014-06-19 18:52:00 UTC) #1
adonovan
The default behaviour has always been to print errors to standard error, and this is ...
11 years, 6 months ago (2014-06-19 18:55:55 UTC) #2
gmk
The default behavior in go/types isn't to print them, so why should go/loader? Whatever it ...
11 years, 6 months ago (2014-06-19 19:05:53 UTC) #3
adonovan
On 2014/06/19 19:05:53, gmk wrote: > The default behavior in go/types isn't to print them, ...
11 years, 6 months ago (2014-06-19 19:18:23 UTC) #4
gmk
11 years, 6 months ago (2014-06-19 19:46:12 UTC) #5
go/loader doesn't silently accumulate errors unless you explicitly set
AllowErrors=true.

Of course it is not desirable to change existing behavior, but at this point I
think it is more important to get the right behavior.  The docs make it clear
that this package is unstable.

I can understand that printing errors might be a sensible default for
command-line tools, but we shouldn't assume that all clients are like that. 
Even if I was writing a command-line tool, I would rather have the
responsibility of printing errors at the appropriate time and place than have it
done for me.

Does anything in the standard library print its errors by default?  It's
paranoid to worry that users will forget to check for errors.  This is Go - The
Language In Which We Check For Errors.  :-)
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b