Skip to content

Instantly share code, notes, and snippets.

func httpHandler(next http.Handler) http.Handler {
fn := func(w http.ResponseWriter, r *http.Request) {
next.ServeHTTP(w, r)
}
return http.HandlerFunc(fn)
}

Keybase proof

I hereby claim:

  • I am kare on github.
  • I am kare (https://keybase.io/kare) on keybase.
  • I have a public key whose fingerprint is 8A09 67D5 731C 7EE3 5B95 DF9F 8AC3 1763 3388 A6E6

To claim this, I am signing this object:

@kare
kare / apple-keyboard-unicode-symbols.tsv
Last active September 9, 2015 15:11
Apple Keyboard Unicode Symbols
Character Hex ASCII Description
238B 9099 Esc
232B 9003 Backspace / Delete
21EA 8682 Capslock
23CE 9166 Return
21E7 8679 Shift
2325 8997 Option
2318 8984 Command
@kare
kare / hello.c
Last active November 22, 2016 13:09
plan9port: Hello, World!
#include <u.h>
#include <libc.h>
void
main(void)
{
print("Hello, World!\n");
exits(0);
}
@kare
kare / plan9-bind-net-tcp-proc.txt
Created November 18, 2016 09:50
bind /net/tcp /proc; ps -ef # Plan 9
kkn% ps -ef
glenda 1 0:00 0:00 268K Await bootrc
glenda 3 0:00 0:00 0K Wakeme mouse
glenda 5 0:00 0:00 0K Wakeme alarm
glenda 7 0:00 0:00 188K Pread paqfs
glenda 9 0:00 0:00 128K Pread mntgen
glenda 14 0:00 0:00 136K Pread mntgen
glenda 18 0:00 0:00 116K Pread mntgen
glenda 30 0:00 0:00 0K Wakeme aoesweep
glenda 36 0:00 0:00 0K Wakeme rxmitproc
@kare
kare / go-unit-test-setup-and-teardown-math.go
Created November 22, 2016 17:04
Go unit test setup and teardown math.go
package math
func Sum(a, b int) int {
return a + b
}
@kare
kare / go-unit-test-setup-and-teardown-math_test.go
Created November 22, 2016 17:15
Go unit test setup and teardown math_test.go
package math
import "testing"
func TestAddition(t *testing.T) {
cases := []struct {
name string
a int
b int
expected int
@kare
kare / go-unit-test-setup-and-teardown-test-run.txt
Created November 22, 2016 17:21
Go unit test setup and teardown test-run.txt
=== RUN TestAddition
=== RUN TestAddition/add
=== RUN TestAddition/minus
=== RUN TestAddition/zero
--- PASS: TestAddition (0.00s)
math_test.go:6: setup test case
--- PASS: TestAddition/add (0.00s)
math_test.go:13: setup sub test
math_test.go:15: teardown sub test
--- PASS: TestAddition/minus (0.00s)
@kare
kare / go-unit-test-setup-and-teardown-math_setup_and_teardown_test.go
Created November 22, 2016 17:53
Go unit test setup and teardown math_test.go
package math
import "testing"
func setupTestCase(t *testing.T) func(t *testing.T) {
t.Log("setup test case")
return func(t *testing.T) {
t.Log("teardown test case")
}
}
@kare
kare / go-unit-test-setup-and-teardown-test-run-single.txt
Created November 24, 2016 13:44
Go unit test setup and teardown test-run-single.txt
=== RUN TestAddition
=== RUN TestAddition/add
--- PASS: TestAddition (0.00s)
math_test.go:6: setup test case
--- PASS: TestAddition/add (0.00s)
math_test.go:13: setup sub test
math_test.go:15: teardown sub test
math_test.go:8: teardown test case
PASS
ok github.com/kare/go-unit-test-setup-teardown 0.012s