dynamo-browse/internal/common/ui/commandctrl/context.go
Leon Mika 5a69e6c954 sqs-browse: remove assumption regarding table keys
Table keys are now retrieved from describe
2022-03-25 08:17:52 +11:00

17 lines
390 B
Go

package commandctrl
import "context"
type commandArgContextKeyType struct{}
var commandArgContextKey = commandArgContextKeyType{}
func WithCommandArgs(ctx context.Context, args []string) context.Context {
return context.WithValue(ctx, commandArgContextKey, args)
}
func CommandArgs(ctx context.Context) []string {
args, _ := ctx.Value(commandArgContextKey).([]string)
return args
}