From e1485f27fc73b93b6426b218840d4d6a963cc06e Mon Sep 17 00:00:00 2001 From: James Bardin Date: Wed, 12 Feb 2025 08:13:55 -0500 Subject: [PATCH] use go tool to run generate commands --- internal/configs/configschema/schema.go | 2 +- internal/configs/provisioner.go | 4 ++-- internal/configs/variable_type_hint.go | 2 +- internal/legacy/helper/schema/resource_data_get_source.go | 2 +- internal/legacy/helper/schema/valuetype.go | 2 +- internal/legacy/terraform/resource_mode.go | 2 +- internal/moduletest/progress.go | 2 +- internal/moduletest/status.go | 2 +- internal/plans/action.go | 2 +- internal/plans/changes.go | 2 +- internal/plans/mode.go | 2 +- internal/plans/quality.go | 2 +- internal/plugin/mock_proto/generate.go | 2 +- 13 files changed, 14 insertions(+), 14 deletions(-) diff --git a/internal/configs/configschema/schema.go b/internal/configs/configschema/schema.go index 5ce268fc55..0e5d387c30 100644 --- a/internal/configs/configschema/schema.go +++ b/internal/configs/configschema/schema.go @@ -124,7 +124,7 @@ type NestingMode int // Object represents the embedding of a NestedBl -//go:generate go run golang.org/x/tools/cmd/stringer -type=NestingMode +//go:generate go tool golang.org/x/tools/cmd/stringer -type=NestingMode const ( nestingModeInvalid NestingMode = iota diff --git a/internal/configs/provisioner.go b/internal/configs/provisioner.go index 7c6e3b829e..36213fde87 100644 --- a/internal/configs/provisioner.go +++ b/internal/configs/provisioner.go @@ -206,7 +206,7 @@ type Connection struct { // ProvisionerWhen is an enum for valid values for when to run provisioners. type ProvisionerWhen int -//go:generate go run golang.org/x/tools/cmd/stringer -type ProvisionerWhen +//go:generate go tool golang.org/x/tools/cmd/stringer -type ProvisionerWhen const ( ProvisionerWhenInvalid ProvisionerWhen = iota @@ -218,7 +218,7 @@ const ( // for provisioners. type ProvisionerOnFailure int -//go:generate go run golang.org/x/tools/cmd/stringer -type ProvisionerOnFailure +//go:generate go tool golang.org/x/tools/cmd/stringer -type ProvisionerOnFailure const ( ProvisionerOnFailureInvalid ProvisionerOnFailure = iota diff --git a/internal/configs/variable_type_hint.go b/internal/configs/variable_type_hint.go index 59556874dd..7ec6ea3cfa 100644 --- a/internal/configs/variable_type_hint.go +++ b/internal/configs/variable_type_hint.go @@ -22,7 +22,7 @@ package configs // - TypeHintMap requires a type that could be converted to an object type VariableTypeHint rune -//go:generate go run golang.org/x/tools/cmd/stringer -type VariableTypeHint +//go:generate go tool golang.org/x/tools/cmd/stringer -type VariableTypeHint // TypeHintNone indicates the absence of a type hint. Values specified in // ambiguous contexts will be treated as literal strings, as if TypeHintString diff --git a/internal/legacy/helper/schema/resource_data_get_source.go b/internal/legacy/helper/schema/resource_data_get_source.go index 068bff36c8..76affb83c3 100644 --- a/internal/legacy/helper/schema/resource_data_get_source.go +++ b/internal/legacy/helper/schema/resource_data_get_source.go @@ -3,7 +3,7 @@ package schema -//go:generate go run golang.org/x/tools/cmd/stringer -type=getSource resource_data_get_source.go +//go:generate go tool golang.org/x/tools/cmd/stringer -type=getSource resource_data_get_source.go // getSource represents the level we want to get for a value (internally). // Any source less than or equal to the level will be loaded (whichever diff --git a/internal/legacy/helper/schema/valuetype.go b/internal/legacy/helper/schema/valuetype.go index 1084a0e0f5..0741d96ed7 100644 --- a/internal/legacy/helper/schema/valuetype.go +++ b/internal/legacy/helper/schema/valuetype.go @@ -3,7 +3,7 @@ package schema -//go:generate go run golang.org/x/tools/cmd/stringer -type=ValueType valuetype.go +//go:generate go tool golang.org/x/tools/cmd/stringer -type=ValueType valuetype.go // ValueType is an enum of the type that can be represented by a schema. type ValueType int diff --git a/internal/legacy/terraform/resource_mode.go b/internal/legacy/terraform/resource_mode.go index 263e70d778..8eef737730 100644 --- a/internal/legacy/terraform/resource_mode.go +++ b/internal/legacy/terraform/resource_mode.go @@ -3,7 +3,7 @@ package terraform -//go:generate go run golang.org/x/tools/cmd/stringer -type=ResourceMode -output=resource_mode_string.go resource_mode.go +//go:generate go tool golang.org/x/tools/cmd/stringer -type=ResourceMode -output=resource_mode_string.go resource_mode.go // ResourceMode is deprecated, use addrs.ResourceMode instead. // It has been preserved for backwards compatibility. diff --git a/internal/moduletest/progress.go b/internal/moduletest/progress.go index b5172dbde9..aa15b7203b 100644 --- a/internal/moduletest/progress.go +++ b/internal/moduletest/progress.go @@ -8,7 +8,7 @@ package moduletest // We will include the progress markers to provide feedback as each test file // executes. // -//go:generate go run golang.org/x/tools/cmd/stringer -type=Progress progress.go +//go:generate go tool golang.org/x/tools/cmd/stringer -type=Progress progress.go type Progress int const ( diff --git a/internal/moduletest/status.go b/internal/moduletest/status.go index 859feed1a4..a7f4c1440c 100644 --- a/internal/moduletest/status.go +++ b/internal/moduletest/status.go @@ -13,7 +13,7 @@ package moduletest // // See the Status.Merge function for this requirement being used in action. // -//go:generate go run golang.org/x/tools/cmd/stringer -type=Status status.go +//go:generate go tool golang.org/x/tools/cmd/stringer -type=Status status.go type Status int const ( diff --git a/internal/plans/action.go b/internal/plans/action.go index 04dcca2dbf..5105deba64 100644 --- a/internal/plans/action.go +++ b/internal/plans/action.go @@ -20,7 +20,7 @@ const ( Close Action = '⫏' ) -//go:generate go run golang.org/x/tools/cmd/stringer -type Action +//go:generate go tool golang.org/x/tools/cmd/stringer -type Action // IsReplace returns true if the action is one of the actions that // represent replacing an existing object with a new object. diff --git a/internal/plans/changes.go b/internal/plans/changes.go index 662a28a04d..2b57d43e5e 100644 --- a/internal/plans/changes.go +++ b/internal/plans/changes.go @@ -413,7 +413,7 @@ func (rc *ResourceInstanceChange) Simplify(destroying bool) *ResourceInstanceCha // apply step. type ResourceInstanceChangeActionReason rune -//go:generate go run golang.org/x/tools/cmd/stringer -type=ResourceInstanceChangeActionReason changes.go +//go:generate go tool golang.org/x/tools/cmd/stringer -type=ResourceInstanceChangeActionReason changes.go const ( // In most cases there's no special reason for choosing a particular diff --git a/internal/plans/mode.go b/internal/plans/mode.go index d8110e785c..ed89aad53c 100644 --- a/internal/plans/mode.go +++ b/internal/plans/mode.go @@ -6,7 +6,7 @@ package plans // Mode represents the various mutually-exclusive modes for creating a plan. type Mode rune -//go:generate go run golang.org/x/tools/cmd/stringer -type Mode +//go:generate go tool golang.org/x/tools/cmd/stringer -type Mode const ( // NormalMode is the default planning mode, which aims to synchronize the diff --git a/internal/plans/quality.go b/internal/plans/quality.go index b5e2a579e3..d21122c093 100644 --- a/internal/plans/quality.go +++ b/internal/plans/quality.go @@ -8,7 +8,7 @@ package plans // have multiple qualities. type Quality int -//go:generate go run golang.org/x/tools/cmd/stringer -type Quality +//go:generate go tool golang.org/x/tools/cmd/stringer -type Quality const ( // Errored plans did not successfully complete, and cannot be applied. diff --git a/internal/plugin/mock_proto/generate.go b/internal/plugin/mock_proto/generate.go index aedd46a193..fdfc1696bd 100644 --- a/internal/plugin/mock_proto/generate.go +++ b/internal/plugin/mock_proto/generate.go @@ -1,6 +1,6 @@ // Copyright (c) HashiCorp, Inc. // SPDX-License-Identifier: BUSL-1.1 -//go:generate go run go.uber.org/mock/mockgen -destination mock.go github.com/hashicorp/terraform/internal/tfplugin5 ProviderClient,ProvisionerClient,Provisioner_ProvisionResourceClient,Provisioner_ProvisionResourceServer +//go:generate go tool go.uber.org/mock/mockgen -destination mock.go github.com/hashicorp/terraform/internal/tfplugin5 ProviderClient,ProvisionerClient,Provisioner_ProvisionResourceClient,Provisioner_ProvisionResourceServer package mock_tfplugin5