Skip to content

Instantly share code, notes, and snippets.

View jeanbza's full-sized avatar
🐘

Jean Barkhuysen jeanbza

🐘
View GitHub Profile
@jeanbza
jeanbza / sema_test.go
Created August 25, 2021 14:35
sema_test.go
package jdksync
import (
"testing"
"time"
)
func TestItAll(t *testing.T) {
s := NewSema()
@jeanbza
jeanbza / sema.go
Created August 25, 2021 14:35
sema.go
package jdksync
import (
"sync"
)
type Sema struct {
s chan chan struct{}
mu sync.Mutex
now, let's convert digraph with `usage`
with the following usage,
var digraphHelp = usage.Text{
Pages: []usage.Page{{Content: []byte(`
Directed graph.
Usage:
digraph nodes
language errors are quite confusing. ex, the following:
digraph: language error: DocLanguage:20:20: expect '\n' / $ got ".*\nTranspose <- tran"
(for the following language:
const language = `
Nodes <- nodes .*
Transpose <- transpose .*
Somepath <- somepath .*
deklerk at deklerk1 in /tmp/gorelease-load041932279
$ cd /tmp/gorelease-load394541697
deklerk at deklerk1 in /tmp/gorelease-load394541697
$ export GO111MODULE=on GOSUMDB=off GOPROXY=file:///tmp/gorelease-proxy046518594 GOPATH=/tmp/gorelease_test-gocache080203705
deklerk at deklerk1 in /tmp/gorelease-load394541697
$ vim go.mod
deklerk at deklerk1 in /tmp/gorelease-load394541697
$ cat go.mod
module gorelease-load-module
deklerk at deklerk1 in /tmp/gorelease-load505395711
$ cd /tmp/gorelease-load041932279
deklerk at deklerk1 in /tmp/gorelease-load041932279
$ export GO111MODULE=on GOSUMDB=off GOPROXY=file:///tmp/gorelease-proxy892534608 GOPATH=/tmp/gorelease_test-gocache023264367
deklerk at deklerk1 in /tmp/gorelease-load041932279
$ ls
go.mod go.sum tmp.go
deklerk at deklerk1 in /tmp/gorelease-load041932279
$ cat go.mod
module gorelease-load-module
deklerk at deklerk1 in /tmp/gorelease-load654758519
$ go mod graph
gorelease-load-module example.com/empty@v0.0.3
deklerk at deklerk1 in /tmp/gorelease-load654758519
$ ls
go.mod go.sum tmp.go
deklerk at deklerk1 in /tmp/gorelease-load654758519
$ cat go.mod
module gorelease-load-module
$ go mod graph
\cloud.google.com/go cloud.google.com/go/bigquery@v1.0.1
cloud.google.com/go cloud.google.com/go/datastore@v1.0.0
cloud.google.com/go cloud.google.com/go/pubsub@v1.0.1
cloud.google.com/go cloud.google.com/go/storage@v1.0.0
cloud.google.com/go github.com/golang/mock@v1.3.1
cloud.google.com/go github.com/golang/protobuf@v1.3.2
cloud.google.com/go github.com/google/go-cmp@v0.3.0
cloud.google.com/go github.com/google/martian@v2.1.0+incompatible
cloud.google.com/go github.com/google/pprof@v0.0.0-20190515194954-54271f7e092f
@jeanbza
jeanbza / retry_adtl_notes.md
Created November 20, 2019 18:10
Retry Additional Notes

The following are additional notes about which RPCs should retry which failed RPCs.

Idempotency and pragmaticism

A common concern with retrying CREATE and DELETE operations is that they are non-idempotent operations. The functional concern can be summarized with this example:

Get("Foo")
// // Copyright 2019 The Go Authors. All rights reserved.
// // Use of this source code is governed by the Apache 2.0
// // license that can be found in the LICENSE file.
package main_test
import (
"fmt"
"io/ioutil"
"net/http"