diff --git a/cli-plugins/hooks/hook_types.go b/cli-plugins/hooks/hook_types.go index 39d6dd0a78..a8ee4f2465 100644 --- a/cli-plugins/hooks/hook_types.go +++ b/cli-plugins/hooks/hook_types.go @@ -12,3 +12,19 @@ type Request struct { Flags map[string]string CommandError string } + +// Response represents a plugin hook response. Plugins +// declaring support for CLI hooks need to print a JSON +// representation of this type when their hook subcommand +// is invoked. +type Response struct { + Type HookType + Template string +} + +// HookMessage represents a plugin hook response. +// +// Deprecated: use [Response] instead. +// +//go:fix inline +type HookMessage = Response diff --git a/cli-plugins/hooks/template.go b/cli-plugins/hooks/template.go index e6bd69f387..7867c2617f 100644 --- a/cli-plugins/hooks/template.go +++ b/cli-plugins/hooks/template.go @@ -17,15 +17,6 @@ const ( NextSteps = iota ) -// HookMessage represents a plugin hook response. Plugins -// declaring support for CLI hooks need to print a json -// representation of this type when their hook subcommand -// is invoked. -type HookMessage struct { - Type HookType - Template string -} - // TemplateReplaceSubcommandName returns a hook template string // that will be replaced by the CLI subcommand being executed // diff --git a/cli-plugins/manager/hooks.go b/cli-plugins/manager/hooks.go index 1923844515..a58a443944 100644 --- a/cli-plugins/manager/hooks.go +++ b/cli-plugins/manager/hooks.go @@ -86,7 +86,7 @@ func invokeAndCollectHooks(ctx context.Context, cfg *configfile.ConfigFile, root return nil, false, err } - var message hooks.HookMessage + var message hooks.Response if err := json.Unmarshal(resp, &message); err != nil { return nil, false, fmt.Errorf("failed to unmarshal hook response (%q): %w", string(resp), err) }