INNER CODE UNIT · Go

withOutput

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

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

func output(ctx context.Context) io.Writer {
	if w, ok := ctx.Value(contextKeyOutput).(io.Writer); ok {
		return w
	}
	return os.Stdout
}

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…