Skip to content

Instantly share code, notes, and snippets.

View dnephin's full-sized avatar

Daniel Nephin dnephin

View GitHub Profile
@dnephin
dnephin / go-trace-build.md
Created June 15, 2022 16:53
Trace golang build time
go build -debug-actiongraph=compile.json
jq 'sort_by(.CmdReal) | reverse | .[] | select(.CmdReal != null) | {Time: (.CmdReal / 1000 / 1000 / 1000), Package}' compile.json | less
@dnephin
dnephin / checks.md
Created August 11, 2021 18:08
Consul - all the paths to register a check
@dnephin
dnephin / gotestsum-with-benchmarks.txt
Created April 17, 2021 19:45
gotestsum with benchmarks
$ go test -bench Something -run Nothing -tags stubpkg ./testjson/internal/good/
goos: linux
goarch: amd64
pkg: gotest.tools/gotestsum/testjson/internal/good
cpu: Intel(R) Core(TM) i7-4790K CPU @ 4.00GHz
BenchmarkSomething-8 88722897 13.12 ns/op
PASS
ok gotest.tools/gotestsum/testjson/internal/good 1.181s
@dnephin
dnephin / 1. background.md
Last active June 12, 2020 15:35
mapstructure, and opaque configuration in Consul
@dnephin
dnephin / list.txt
Created September 23, 2018 17:12
Clojure test reporters
https://github.com/venantius/ultra
https://github.com/weavejester/eftest
https://github.com/lambdaisland/kaocha
@dnephin
dnephin / logging.go
Last active November 15, 2019 16:49
Go - Logger from context.Context
package logging
import (
"context"
"github.com/sirupsen/logrus"
)
type (
fieldsKey struct{}
@dnephin
dnephin / keybase.md
Created June 27, 2018 15:08
keybase.md

Keybase proof

I hereby claim:

  • I am dnephin on github.
  • I am dnephin (https://keybase.io/dnephin) on keybase.
  • I have a public key ASAbunDvxglCI9lECiuhCXKI2kFxyYsu4nP6bJ0MsJKtIgo

To claim this, I am signing this object:

@dnephin
dnephin / cmd-main-main.go
Created February 4, 2018 19:11
Testing golang plugins with package init()
package main
import (
"fmt"
"github.com/dnephin/ppp/foo"
"plugin"
)
func main() {
fmt.Println("MAIN")
@dnephin
dnephin / replace.sh
Last active January 23, 2018 19:03
Bash multi-line replace t.Error; return -> t.Fatal
#!/usr/bin/env sh
set -eu -o pipefail
git grep -A 1 '\st\.Error' | \
grep 'return$' -B 2 | \
cut -f1 | \
grep -v -- '--' |
sed 's/.$//' | \
sort | \
uniq | while read filename; do
Developer Certificate of Origin
Version 1.1
Copyright (C) 2004, 2006 The Linux Foundation and its contributors.
1 Letterman Drive
Suite D4700
San Francisco, CA, 94129
Everyone is permitted to copy and distribute verbatim copies of this
license document, but changing it is not allowed.