Index | Examples | Files

package skip

import ""

Package skip provides functions for skipping a test and printing the source code of the condition used to skip the test.



Package Files


func If Uses

func If(t skipT, condition BoolOrCheckFunc, msgAndArgs ...interface{})

If the condition expression evaluates to true, or the condition function returns true, skip the test. The skip message will contain the source code of the expression. Extra message text can be passed as a format string with args


//   --- SKIP: TestName (0.00s)
//           skip.go:19: MissingFeature
skip.If(t, MissingFeature)

//   --- SKIP: TestName (0.00s)
//           skip.go:19: MissingFeature: coming soon
skip.If(t, MissingFeature, "coming soon")


//   --- SKIP: TestName (0.00s)
//           skip.go:19: apiVersion < version("v1.24")
skip.If(t, apiVersion < version("v1.24"))

//   --- SKIP: TestName (0.00s)
//           skip.go:19: !textenv.hasFeature("build"): coming soon
skip.If(t, !testEnv.hasFeature("build"), "coming soon")

type BoolOrCheckFunc Uses

type BoolOrCheckFunc interface{}

BoolOrCheckFunc can be a bool or func() bool, other types will panic

Package skip imports 7 packages (graph) and is imported by 1 packages. Updated 2018-08-15. Refresh now. Tools for package owners.