INNER CODE UNIT · Go

checkError

grafana-cold-storage/phlare · cmd/profilecli/main.go:97

func checkError(err error) int {
	if err != nil {
		fmt.Fprintf(os.Stderr, "error: %v\n", err)
		return 1
	}
	return 0
}

type contextKey uint8

const (
	contextKeyOutput contextKey = iota
)

func withOutput(ctx context.Context, w io.Writer) context.Context {
	return context.WithValue(ctx, contextKeyOutput, w)
}

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…