Our incident.io pkg/errors, as explained in:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
graph Doskvol { | |
concentrate=true; | |
edge[color=forestgreen] | |
subgraph legend { | |
color = black; | |
label = "Legend"; | |
"Tier I"--"Tier II"--"Tier III"--"Tier IV"--"Tier V" | |
} | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### colored and fuzzy go doc | |
if which bat > /dev/null; then | |
function _godoc() { | |
if echo $1|grep -q -E "^([a-zA-Z0-9/]+)$"; then | |
go doc ${@} | bat -p -l md | |
elif echo $1|grep -q -E "^[a-zA-Z0-9/]+\.[a-zA-Z0-9.]+$"; then | |
go doc ${@} | bat -p -l go | |
elif echo $1|grep -q -E "^([a-zA-Z0-9/._-]+)/.*\.[a-zA-Z0-9.]+$"; then | |
go doc ${@} | bat -p -l go | |
else |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ConsoleHandler formats slog.Logger output in console format, a bit similar with Uber's zap ConsoleEncoder | |
// The log format is designed to be human-readable. | |
// | |
// Performance can definitely be improved, however it's not in my priority as | |
// this should only be used in development environment. | |
// | |
// e.g. log output: | |
// 2022-11-24T11:40:20+08:00 DEBUG ./main.go:162 Debug message {"hello":"world","!BADKEY":"bad kv"} | |
// 2022-11-24T11:40:20+08:00 INFO ./main.go:167 Info message {"with_key_1":"with_value_1","group_1":{"with_key_2":"with_value_2","hello":"world"}} | |
// 2022-11-24T11:40:20+08:00 WARN ./main.go:168 Warn message {"with_key_1":"with_value_1","group_1":{"with_key_2":"with_value_2","hello":"world"}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package workload | |
import ( | |
"context" | |
"golang.org/x/sync/errgroup" | |
"time" | |
) | |
type Worker func() error |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"context" | |
"encoding/json" | |
"errors" | |
"fmt" | |
"log" | |
"net/http" | |
"os" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package do | |
type Void struct{} | |
type Result[T any] interface { | |
Unwrap() (T, error) | |
} | |
type defaultResult[T any] struct { | |
val T |
After reading Rouan Wilsenach’s article on Ship / Show / Ask, I realized that when creating a pull request, I’m thinking about:
- How can I confidently get my code out of the door?
- Will my changes pass the automated CI checks?
- Will my changes pass a self-review? I.e. would I approve my own PR?
- Will my colleagues be able to give me good feedback?
2. When you click on the little recylcing symbol next to a question or answer "Show activity on this post", you will get to the timeline:
https://stackoverflow.com/posts/69419917/timeline#history_9281a690-64c3-4302-bb36-1ebb6dfd3ecf
Go to Question revision history:
NewerOlder