// lintErrors examines global error vars. It complains if they aren't named in the standard way.
779565
func (f *file) lintErrors() {
	for _, decl := range f.f.Decls {
		gd, ok := decl.(*ast.GenDecl)
		if !ok || gd.Tok != token.VAR {
			continue
		}
		for _, spec := range gd.Specs {
			spec := spec.(*ast.ValueSpec)
			if len(spec.Names) != 1 || len(spec.Values) != 1 {
				continue
			}
			ce, ok := spec.Values[0].(*ast.CallExpr)
			if !ok {
				continue
			}
			if !isPkgDot(ce.Fun, "errors", "New") && !isPkgDot(ce.Fun, "fmt", "Errorf") {
				continue
			}

			id := spec.Names[0]
			prefix := "err"
			if id.IsExported() {
				prefix = "Err"
			}
			if !strings.HasPrefix(id.Name, prefix) {
				f.errorf(id, 0.9, category("naming"), "error var %s should have name of the form %sFoo", id.Name, prefix)
			}
		}
	}
}
460127
func (f *validationFailer) HasErrors() bool {
	f.mux.Lock()
	defer f.mux.Unlock()
	return len(f.errs) > 0
}
1325783
func GetErrorAllDescriptors() []ErrorDescriptor {
	result := []ErrorDescriptor{}

	for _, group := range GetGroupNames() {
		result = append(result, GetErrorCodeGroup(group)...)
	}
	sort.Sort(byValue(result))
	return result
}
199695
func (s *BatchDeleteTableOutput) SetErrors(v []*TableError) *BatchDeleteTableOutput {
	s.Errors = v
	return s
}
426014
func (s *ValidateSecurityProfileBehaviorsOutput) SetValidationErrors(v []*ValidationError) *ValidateSecurityProfileBehaviorsOutput {
	s.ValidationErrors = v
	return s
}
708493
func (aer *AllErrorRecorder) HasErrors() bool {
	aer.mu.Lock()
	defer aer.mu.Unlock()
	return len(aer.Errors) > 0
}
1098641
func filterErrors(list []error, fns ...Matcher) []error {
	result := []error{}
	for _, err := range list {
		r := FilterOut(err, fns...)
		if r != nil {
			result = append(result, r)
		}
	}
	return result
}
242763
func CheckErrorValues(refvs []reflect.Value) (err error) {
	for _, refv := range refvs {
		if refv.IsValid() {
			refvi := refv.Interface()
			switch refvi.(type) {
			case error:
				return refvi.(error)
			}
		}
	}
	return
}
868028
func (s *ValidationError) SetErrors(v []*string) *ValidationError {
	s.Errors = v
	return s
}
731487
func WalkErrors(base ErrorObject, walkFunc WalkFunc) (err error) {
	if base == nil {
		return
	}

	loopCheckMap := map[ErrorObject]bool{}
	for base != nil {
		if _, exist := loopCheckMap[base]; exist {
			return ErrorWalkLoop.New(nil)
		}
		loopCheckMap[base] = true

		stop, walkerr := walkFunc(base)
		if walkerr != nil {
			return walkerr
		}
		if stop {
			return
		}

		base = base.Parent()
	}

	return
}
369877
func (aer *AllErrorRecorder) GetErrors() []error {
	aer.mu.Lock()
	defer aer.mu.Unlock()
	return aer.Errors
}
841912
func (l *Linter) Lint(filename string, src []byte) ([]Problem, error) {
	return l.LintFiles(map[string][]byte{filename: src})
}
1151394
func (m MultiError) Error() string {
	errs := make([]string, len(m.Errors))
	for i, err := range m.Errors {
		errs[i] = err.Error()
	}

	return strings.Join(errs, "\n")
}
1150209
func (ec *ErrorCollection) AddErrors(errs ...error) {
	ec.lock.Lock()
	defer ec.lock.Unlock()

	for _, err := range errs {
		ec.addError(err)
	}
}
1041558
func logErrors(c context.Context, err *googleapi.Error) {
	logging.Errorf(c, "HTTP %d", err.Code)
	for _, err := range err.Errors {
		logging.Errorf(c, "%s", err.Message)
	}
}
475444
func (h *ErrorVector) GetErrorList(mode int) ErrorList {
	if len(h.errors) == 0 {
		return nil
	}

	list := make(ErrorList, len(h.errors))
	copy(list, h.errors)

	if mode >= Sorted {
		sort.Sort(list)
	}

	if mode >= NoMultiples {
		var last token.Position // initial last.Line is != any legal error line
		i := 0
		for _, e := range list {
			if e.Pos.Filename != last.Filename || e.Pos.Line != last.Line {
				last = e.Pos
				list[i] = e
				i++
			}
		}
		list = list[0:i]
	}

	return list
}
474810
func FirstError(errs ...error) error {
	for i := range errs {
		if errs[i] != nil {
			return errs[i]
		}
	}
	return nil
}