Skip to content

Commit

Permalink
Do not use *testing.T in the test examples
Browse files Browse the repository at this point in the history
Signed-off-by: Vincent Demeester <[email protected]>
  • Loading branch information
vdemeester authored and tekton-robot committed Apr 1, 2019
1 parent 8690757 commit 9428c43
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions test/wait_example_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ limitations under the License.
package test

import (
"testing"
"time"

"github.com/tektoncd/pipeline/pkg/apis/pipeline/v1alpha1"
Expand All @@ -28,10 +27,14 @@ var (
// Golang Example functions do not take `t *testing.T` as argument, so we "fake"
// it so that examples still compiles (`go test` tries to compile those) and look
// nice in the go documentation.
t *testing.T
t testingT
c *clients
)

type testingT interface {
Errorf(string, ...interface{})
}

func ExampleWaitForTaskRunState() {
// […] setup the test, get clients
if err := WaitForTaskRunState(c, "taskRunName", func(tr *v1alpha1.TaskRun) (bool, error) {
Expand Down

0 comments on commit 9428c43

Please sign in to comment.