On Thu, 2022-03-03 at 05:50 -0800, twp...@gmail.com wrote: > For debugging an individual test case, just skip over all but the > failing test case: > > for i, testCase := range testCases { > if i != 5 { // 5 is the index of the failing test, remove if > statement before committing > continue > } > t.Run(strconv.Itoa(i), func(t *testing.T) { > // ... > > It's a quick cheap hack, but occasionally useful.
This can be done with `go test -run ^TestTheTest/5$`. Meaningful names make it even better. -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/92defab99276c7729c8181a285dc260357f651db.camel%40kortschak.io.