Standard library / testing
testing.InternalTest
Descriptor for a named test and callback in generated test infrastructure. Prefer TestXxx functions. Expected stdout: 'TestDemo true\n'.
Formal Syntax & Structure
go syntaxgo
type InternalTest struct { Name string F func(*T)}Working Example
Example Snippetgo
package main
import ( "fmt" "testing")
func main() { d := testing.InternalTest{Name: "TestDemo", F: func(t *testing.T) {}} fmt.Println(d.Name, d.F != nil)}