Standard library / testing
testing.T.Skipf()
Format the skip reason then stop the current test goroutine. Expected stdout: 'cleanup\nPASS\n'. Run as a _test.go file using the Go test harness.
Formal Syntax & Structure
go syntaxgo
func (c *T) Skipf(format string, args ...any)Parameters & Attributes
| Name | Type | Description |
|---|---|---|
| format | string | Formatting directive string. |
| args | ...any | Arguments supplied to logging, skipping or corpus entry as applicable. |
Working Example
Example Snippetgo
package main
import ( "fmt" "testing")
func TestReference(t *testing.T) { t.Cleanup(func() { fmt.Println("cleanup") }) t.Skipf("missing %s", "fixture")}