Skip to content

Instantly share code, notes, and snippets.

View thiagocaiubi's full-sized avatar
😄

Thiago Caiubi thiagocaiubi

😄
View GitHub Profile
@posener
posener / go-table-driven-tests-parallel.md
Last active April 30, 2024 20:34
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()
@maxivak
maxivak / _readme.md
Last active June 8, 2022 06:19
Vagrant with Ubuntu 16.04 in VirtualBox

Setup Ubuntu 16.04 to be used with Vagrant and Virtualbox

Prepare Vagrant box with Ubuntu 16.04

We will use official box "ubuntu/xenial64" and modify it to work with Vagrant.

  • Vagrantfile
#!/usr/bin/env node
var readline = require('readline'),
unflatten = require('flat').unflatten,
logfmt = require('logfmt');
var rl = readline.createInterface({
input: process.stdin,
output: process.stdout
});