From d7f2ea810f481a229be853c054e08671f63b69e6 Mon Sep 17 00:00:00 2001 From: Robert Griesemer Date: Tue, 2 Sep 2014 15:53:24 -0700 Subject: [PATCH] go.tools/go/types: document Config.Error better LGTM=adonovan R=adonovan, dsymonds CC=golang-codereviews https://golang.org/cl/137960044 --- go/types/api.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/go/types/api.go b/go/types/api.go index 2079a384..2cf80960 100644 --- a/go/types/api.go +++ b/go/types/api.go @@ -102,6 +102,8 @@ type Config struct { // Secondary errors (for instance, to enumerate all types // involved in an invalid recursive type declaration) have // error strings that start with a '\t' character. + // If Error == nil, type-checking stops with the first + // error found. Error func(err error) // If Import != nil, it is called for each imported package. @@ -321,7 +323,8 @@ func (init *Initializer) String() string { // Check type-checks a package and returns the resulting package object, // the first error if any, and if info != nil, additional type information. // The package is marked as complete if no errors occurred, otherwise it is -// incomplete. +// incomplete. See Config.Error for controlling behavior in the presense of +// errors. // // The package is specified by a list of *ast.Files and corresponding // file set, and the package path the package is identified with.