Package diagnostics provides utilities to collect diagnostics for lint.



    This section is empty.


    This section is empty.


    This section is empty.


    type Result

    type Result struct {
    	Errors errors.MultiError
    	// contains filtered or unexported fields

      Result contains diagnostic messages from lint.

      func (*Result) AppendError

      func (r *Result) AppendError(f string, args ...interface{})

        AppendError appends an error to result, prefixed with current context.

        func (*Result) Display

        func (r *Result) Display() []string

          Display returns a user-friendly display of diagnostics from a Result.

          func (*Result) IsValid

          func (r *Result) IsValid() bool

            IsValid returns false if the result contains any validation errors, true otherwise.

            func (*Result) Merge

            func (r *Result) Merge(o Result)

              Merge merges another result into the current result.

              Diagnostic messages from the incoming Result are prefixed with the current Result's context. Context from the incoming Result is ignored.

              func (*Result) PushContext

              func (r *Result) PushContext(c string) (popContext func())

                PushContext adds context to be prepended to all diagnostic messages.

                Contexts can be stacked by calling PushContext() repeatedly. Returns a function to pop the pushed context.

                Source Files