I hereby claim:
- I am aybabtme on github.
- I am antoineg (https://keybase.io/antoineg) on keybase.
- I have a public key whose fingerprint is 6F35 158F 2F17 763B 44F1 4396 C6DD 7E23 7AEA 9856
To claim this, I am signing this object:
lol |
package p2p | |
import ( | |
"bytes" | |
"fmt" | |
"os" | |
"os/signal" | |
"runtime" | |
"sync" | |
"sync/atomic" |
package main | |
import ( | |
"bytes" | |
"flag" | |
"github.com/Shopify/go-lua" | |
"github.com/kortschak/zalgo" | |
"io" | |
"log" | |
"os" |
I hereby claim:
To claim this, I am signing this object:
//go:generate pipeliner map(func(string) (string, error) concurrently as concErrMap into conc_err_map.go | |
func concErrMap(concurrency int, fn func(string) (string, error), in <-chan string) (<-chan string, <-chan error) { | |
out := make(chan string) | |
errc := make(chan error, concurrency) | |
done := make(chan struct{}) | |
go func() { | |
defer close(out) | |
defer close(errc) | |
wg := sync.WaitGroup{} | |
wg.Add(concurrency) |
"snippets": [ | |
{ | |
"text": "sortby", | |
"title": "type bySomeOrder []type", | |
"value": "type $1 []$2\n\nfunc(b $1) Len() int { return len(b) }\nfunc(b $1) Swap(i, j int) { b[i],b[j] = b[j],b[i] }\nfunc(b $1) Less(i, j int) bool { return b[i].$3 < b[j].$3 }" | |
}, | |
], |
// LogHook builds a func that can be fired by a doge/log through | |
// log.AddHook. If the entry it fires on contains an error, it will | |
// include a stacktrace of the logger's callsite. | |
// | |
// import "doge/log" | |
// | |
// log.AddHook( | |
// sentry.LogHook("my.pkg/name"), | |
// log.Lerror, log.Lpanic, log.Lfatal, |
package log | |
import ( | |
"fmt" | |
"log/syslog" | |
"os" | |
"github.com/Sirupsen/logrus" | |
) |
switch { | |
case olderr != nil && newerr != nil: | |
return diff, fmt.Errorf("reading both source, %v", olderr) | |
case olderr != nil: | |
return diff, fmt.Errorf("reading old source, %v", olderr) | |
case newerr != nil: | |
return diff, fmt.Errorf("reading new source, %v", newerr) | |
default: | |
return diff, nil | |
} |
// io.Writer implementer | |
type writer func(p []byte) (int, error) | |
func (w writer) Write(p []byte) (int, error) { return w(p) } | |
// magic, a testing.T writer! | |
func testwriter(t *testing.T) io.Writer { | |
return writer(func(p []byte) (int, error) { | |
t.Log(string(p)) | |
return 0, nil |