clictx

package
v0.6.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 24, 2026 License: MIT Imports: 3 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package clictx carries the resolved runtime and logger on a context.Context so command packages can read them without importing the root cli package (which would create an import cycle). The root command's persistent pre-run populates these; command RunE functions read them.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Logger

func Logger(ctx context.Context) *logging.Logger

Logger extracts the logger from ctx, or nil if absent.

func Runtime

func Runtime(ctx context.Context) *config.Runtime

Runtime extracts the resolved runtime from ctx, or nil if absent.

func WithLogger

func WithLogger(ctx context.Context, l *logging.Logger) context.Context

WithLogger returns a copy of ctx carrying the logger.

func WithRuntime

func WithRuntime(ctx context.Context, rt *config.Runtime) context.Context

WithRuntime returns a copy of ctx carrying the resolved runtime.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL