testerror

package
v0.0.0-...-6fa03d5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 4, 2020 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package testerror contains List type that implements error interface. It can store more than one *rpb.TestError and has some convenience functions to add errors into the List.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type List

type List struct {
	// contains filtered or unexported fields
}

List can be used if more than one *rpb.TestError needs to be returned. It implements the error interface, so it can be returned when an error is needed. Note that the gnmitest framework treats a List with an empty errors slice as a as nil error.

func (*List) AddErr

func (l *List) AddErr(err error)

AddErr adds a non-nil error into the list of errors. If the provided error is an instance of the List struct, its contents (returned by the Errors function) are appended to the receiver's errors slice.

func (*List) AddTestErr

func (l *List) AddTestErr(te ...*rpb.TestError)

AddTestErr appends the provided list of *rpb.TestError into the errors in List struct.

func (*List) Error

func (l *List) Error() string

Error function concatenates the messages in errors slice into single string that represents all the errors.

func (*List) Errors

func (l *List) Errors() []*rpb.TestError

Errors returns the list of *rpb.TestError stored so far.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL