Skip to content

Instantly share code, notes, and snippets.

View aswinkm-tc's full-sized avatar

Aswin K.M. aswinkm-tc

  • Truecaller
  • Sweden
  • 04:27 (UTC +02:00)
View GitHub Profile
@PrasadG193
PrasadG193 / retrywatcher_example.go
Last active April 12, 2024 08:55
An example of using RetryWatcher to watch resource events
package main
import (
"context"
"fmt"
"os"
"path/filepath"
"time"
corev1 "k8s.io/api/core/v1"
@posener
posener / go-table-driven-tests-parallel.md
Last active April 24, 2025 20:46
Be Careful with Table Driven Tests and t.Parallel()

Be Careful with Table Driven Tests and t.Parallel()

We Gophers, love table-driven-tests, it makes our unittesting structured, and makes it easy to add different test cases with ease.

Let’s create our table driven test, for convenience, I chose to use t.Log as the test function. Notice that we don't have any assertion in this test, it is not needed to for the demonstration.

func TestTLog(t *testing.T) {
	t.Parallel()