Skip to content

Commit

Permalink
Add a Data map[string]any field to store arbitrary data for a command.
Browse files Browse the repository at this point in the history
  • Loading branch information
maxlandon committed Dec 4, 2023
1 parent 3d8ac43 commit 03ef288
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions command.go
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,11 @@ type Command struct {
// command does not define one.
Version string

// Data are key/value pairs of arbitrary types that can be used by applications or "plugin" libraries
// that wish to store and use data associated with a given command. This data will thus share the same
// lifetime as the command itself.
Data map[string]any

Check failure on line 117 in command.go

View workflow job for this annotation

GitHub Actions / ubuntu | 1.17.x

undefined: any

Check failure on line 117 in command.go

View workflow job for this annotation

GitHub Actions / macOS | 1.17.x

undefined: any

// The *Run functions are executed in the following order:
// * PersistentPreRun()
// * PreRun()
Expand Down

0 comments on commit 03ef288

Please sign in to comment.