Skip to content

Instantly share code, notes, and snippets.

View aymone's full-sized avatar

Marcelo Aimone aymone

  • Florianópolis/SC - Brasil
View GitHub Profile
@aymone
aymone / job.go
Last active November 25, 2018 22:17
worker pool implementantion
package job
import (
"fmt"
"math/rand"
"time"
"github.com/aymone/workerpool/service"
)
@aymone
aymone / go-table-driven-tests-parallel.md
Created February 23, 2018 15:08 — forked from posener/go-table-driven-tests-parallel.md
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()
@aymone
aymone / .vimrc
Last active August 24, 2017 18:19
" General {
"
" Automatic reloading of .vimrc
autocmd! bufwritepost .vimrc source %"
" Default script encoding
scriptencoding utf-8
" Enable mouse
set mouse=a