diff --git a/internal/addrs/check_rule.go b/internal/addrs/check_rule.go index e7107dd4b8..f6c558e942 100644 --- a/internal/addrs/check_rule.go +++ b/internal/addrs/check_rule.go @@ -82,7 +82,7 @@ func (k checkRuleKey) uniqueKeySigil() {} // itself.) type CheckRuleType int -//go:generate go run golang.org/x/tools/cmd/stringer -type=CheckRuleType check_rule.go +//go:generate go tool golang.org/x/tools/cmd/stringer -type=CheckRuleType check_rule.go const ( InvalidCondition CheckRuleType = 0 diff --git a/internal/addrs/checkable.go b/internal/addrs/checkable.go index e0c41a17ae..19a5c8afcf 100644 --- a/internal/addrs/checkable.go +++ b/internal/addrs/checkable.go @@ -49,7 +49,7 @@ var ( // CheckableKind describes the different kinds of checkable objects. type CheckableKind rune -//go:generate go run golang.org/x/tools/cmd/stringer -type=CheckableKind checkable.go +//go:generate go tool golang.org/x/tools/cmd/stringer -type=CheckableKind checkable.go const ( CheckableKindInvalid CheckableKind = 0 diff --git a/internal/addrs/move_endpoint_kind.go b/internal/addrs/move_endpoint_kind.go index de0fc68a8f..cf1c0dd965 100644 --- a/internal/addrs/move_endpoint_kind.go +++ b/internal/addrs/move_endpoint_kind.go @@ -9,7 +9,7 @@ import "fmt" // address can refer to. type MoveEndpointKind rune -//go:generate go run golang.org/x/tools/cmd/stringer -type MoveEndpointKind +//go:generate go tool golang.org/x/tools/cmd/stringer -type MoveEndpointKind const ( // MoveEndpointModule indicates that a move endpoint either refers to diff --git a/internal/addrs/remove_target_kind.go b/internal/addrs/remove_target_kind.go index 05c035f739..edbe97e62c 100644 --- a/internal/addrs/remove_target_kind.go +++ b/internal/addrs/remove_target_kind.go @@ -9,7 +9,7 @@ import "fmt" // target address can refer to. type RemoveTargetKind rune -//go:generate go run golang.org/x/tools/cmd/stringer -type RemoveTargetKind +//go:generate go tool golang.org/x/tools/cmd/stringer -type RemoveTargetKind const ( // RemoveTargetModule indicates that a remove target refers to diff --git a/internal/addrs/resource.go b/internal/addrs/resource.go index 6e4d3a8360..2c5d4bca8b 100644 --- a/internal/addrs/resource.go +++ b/internal/addrs/resource.go @@ -493,7 +493,7 @@ func (k configResourceKey) uniqueKeySigil() {} // resource lifecycle has a slightly different address format. type ResourceMode rune -//go:generate go run golang.org/x/tools/cmd/stringer -type ResourceMode +//go:generate go tool golang.org/x/tools/cmd/stringer -type ResourceMode const ( // InvalidResourceMode is the zero value of ResourceMode and is not diff --git a/internal/backend/backendrun/operation_type.go b/internal/backend/backendrun/operation_type.go index bb96854523..22abaf8a4f 100644 --- a/internal/backend/backendrun/operation_type.go +++ b/internal/backend/backendrun/operation_type.go @@ -3,7 +3,7 @@ package backendrun -//go:generate go run golang.org/x/tools/cmd/stringer -type=OperationType operation_type.go +//go:generate go tool golang.org/x/tools/cmd/stringer -type=OperationType operation_type.go // OperationType is an enum used with Operation to specify the operation // type to perform for Terraform. diff --git a/internal/backend/remote-state/http/server_test.go b/internal/backend/remote-state/http/server_test.go index e361f8b389..f52659f3c9 100644 --- a/internal/backend/remote-state/http/server_test.go +++ b/internal/backend/remote-state/http/server_test.go @@ -3,7 +3,7 @@ package http -//go:generate go run go.uber.org/mock/mockgen -package $GOPACKAGE -source $GOFILE -destination mock_$GOFILE +//go:generate go tool go.uber.org/mock/mockgen -package $GOPACKAGE -source $GOFILE -destination mock_$GOFILE import ( "context" diff --git a/internal/checks/status.go b/internal/checks/status.go index da9a7d7f94..557fa05ba5 100644 --- a/internal/checks/status.go +++ b/internal/checks/status.go @@ -13,7 +13,7 @@ import ( // checkable object. type Status rune -//go:generate go run golang.org/x/tools/cmd/stringer -type=Status +//go:generate go tool golang.org/x/tools/cmd/stringer -type=Status const ( // StatusUnknown represents that there is not yet a conclusive result diff --git a/internal/cloud/migration.go b/internal/cloud/migration.go index f42e873567..af6dbb5fc2 100644 --- a/internal/cloud/migration.go +++ b/internal/cloud/migration.go @@ -17,7 +17,7 @@ import ( // the context of Cloud integration mode. type ConfigChangeMode rune -//go:generate go run golang.org/x/tools/cmd/stringer -type ConfigChangeMode +//go:generate go tool golang.org/x/tools/cmd/stringer -type ConfigChangeMode const ( // ConfigMigrationIn represents when the configuration calls for using diff --git a/internal/cloudplugin/mock_cloudproto1/generate.go b/internal/cloudplugin/mock_cloudproto1/generate.go index 0c646e453b..d1c2196522 100644 --- a/internal/cloudplugin/mock_cloudproto1/generate.go +++ b/internal/cloudplugin/mock_cloudproto1/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/cloudplugin/cloudproto1 CommandServiceClient,CommandService_ExecuteClient +//go:generate go tool go.uber.org/mock/mockgen -destination mock.go github.com/hashicorp/terraform/internal/cloudplugin/cloudproto1 CommandServiceClient,CommandService_ExecuteClient package mock_cloudproto1 diff --git a/internal/plugin6/mock_proto/generate.go b/internal/plugin6/mock_proto/generate.go index 0d407ef600..2693a8448c 100644 --- a/internal/plugin6/mock_proto/generate.go +++ b/internal/plugin6/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/tfplugin6 ProviderClient +//go:generate go tool go.uber.org/mock/mockgen -destination mock.go github.com/hashicorp/terraform/internal/tfplugin6 ProviderClient package mock_tfplugin6 diff --git a/internal/stacks/stackruntime/hooks/component_instance.go b/internal/stacks/stackruntime/hooks/component_instance.go index b910e74c5d..721cf976a2 100644 --- a/internal/stacks/stackruntime/hooks/component_instance.go +++ b/internal/stacks/stackruntime/hooks/component_instance.go @@ -15,7 +15,7 @@ import ( // types, and the others will be used only for one of plan or apply. type ComponentInstanceStatus rune -//go:generate go run golang.org/x/tools/cmd/stringer -type=ComponentInstanceStatus component_instance.go +//go:generate go tool golang.org/x/tools/cmd/stringer -type=ComponentInstanceStatus component_instance.go const ( ComponentInstanceStatusInvalid ComponentInstanceStatus = 0 diff --git a/internal/stacks/stackruntime/hooks/resource_instance.go b/internal/stacks/stackruntime/hooks/resource_instance.go index 7b576a9de4..b4c82acf2d 100644 --- a/internal/stacks/stackruntime/hooks/resource_instance.go +++ b/internal/stacks/stackruntime/hooks/resource_instance.go @@ -17,7 +17,7 @@ import ( // types, and the others will be used only for one of plan or apply. type ResourceInstanceStatus rune -//go:generate go run golang.org/x/tools/cmd/stringer -type=ResourceInstanceStatus resource_instance.go +//go:generate go tool golang.org/x/tools/cmd/stringer -type=ResourceInstanceStatus resource_instance.go const ( ResourceInstanceStatusInvalid ResourceInstanceStatus = 0 @@ -61,7 +61,7 @@ func (s ResourceInstanceStatus) ForProtobuf() stacks.StackChangeProgress_Resourc // either "provisioned" or "errored". type ProvisionerStatus rune -//go:generate go run golang.org/x/tools/cmd/stringer -type=ProvisionerStatus resource_instance.go +//go:generate go tool golang.org/x/tools/cmd/stringer -type=ProvisionerStatus resource_instance.go const ( ProvisionerStatusInvalid ProvisionerStatus = 0 diff --git a/internal/stacks/stackruntime/internal/stackeval/expressions.go b/internal/stacks/stackruntime/internal/stackeval/expressions.go index 2734a5c1e6..c65a0022b3 100644 --- a/internal/stacks/stackruntime/internal/stackeval/expressions.go +++ b/internal/stacks/stackruntime/internal/stackeval/expressions.go @@ -26,7 +26,7 @@ import ( type EvalPhase rune -//go:generate go run golang.org/x/tools/cmd/stringer -type EvalPhase +//go:generate go tool golang.org/x/tools/cmd/stringer -type EvalPhase const ( NoPhase EvalPhase = 0 diff --git a/internal/stacks/stackstate/statekeys/key_type.go b/internal/stacks/stackstate/statekeys/key_type.go index dc8a2d67d3..ebe64d926b 100644 --- a/internal/stacks/stackstate/statekeys/key_type.go +++ b/internal/stacks/stackstate/statekeys/key_type.go @@ -91,7 +91,7 @@ func isPlausibleRawKeyType(s string) bool { // See the documentation for [KeyType] for more information. type UnrecognizedKeyHandling rune -//go:generate go run golang.org/x/tools/cmd/stringer -type UnrecognizedKeyHandling +//go:generate go tool golang.org/x/tools/cmd/stringer -type UnrecognizedKeyHandling const ( FailIfUnrecognized UnrecognizedKeyHandling = 'F' diff --git a/internal/states/instance_object.go b/internal/states/instance_object.go index 6b4204bbd0..3801d7b353 100644 --- a/internal/states/instance_object.go +++ b/internal/states/instance_object.go @@ -55,7 +55,7 @@ type ResourceInstanceObject struct { // ObjectStatus represents the status of a RemoteObject. type ObjectStatus rune -//go:generate go run golang.org/x/tools/cmd/stringer -type ObjectStatus +//go:generate go tool golang.org/x/tools/cmd/stringer -type ObjectStatus const ( // ObjectReady is an object status for an object that is ready to use. diff --git a/internal/states/statemgr/migrate.go b/internal/states/statemgr/migrate.go index 6ebafaf985..4e688a8842 100644 --- a/internal/states/statemgr/migrate.go +++ b/internal/states/statemgr/migrate.go @@ -132,7 +132,7 @@ func Export(mgr Reader) *statefile.File { // is the receiver of that method and the "second" is the given argument. type SnapshotMetaRel rune -//go:generate go run golang.org/x/tools/cmd/stringer -type=SnapshotMetaRel +//go:generate go tool golang.org/x/tools/cmd/stringer -type=SnapshotMetaRel const ( // SnapshotOlder indicates that two snapshots have a common lineage and diff --git a/internal/terraform/graph_walk_operation.go b/internal/terraform/graph_walk_operation.go index 080676d415..9100c8b881 100644 --- a/internal/terraform/graph_walk_operation.go +++ b/internal/terraform/graph_walk_operation.go @@ -3,7 +3,7 @@ package terraform -//go:generate go run golang.org/x/tools/cmd/stringer -type=walkOperation graph_walk_operation.go +//go:generate go tool golang.org/x/tools/cmd/stringer -type=walkOperation graph_walk_operation.go // walkOperation is an enum which tells the walkContext what to do. type walkOperation byte diff --git a/internal/terraform/node_resource_abstract_instance.go b/internal/terraform/node_resource_abstract_instance.go index 8dc4c5f3cc..975764ab14 100644 --- a/internal/terraform/node_resource_abstract_instance.go +++ b/internal/terraform/node_resource_abstract_instance.go @@ -256,7 +256,7 @@ const ( prevRunState ) -//go:generate go run golang.org/x/tools/cmd/stringer -type phaseState +//go:generate go tool golang.org/x/tools/cmd/stringer -type phaseState // writeResourceInstanceState saves the given object as the current object for // the selected resource instance. diff --git a/internal/terraform/variables.go b/internal/terraform/variables.go index 4adae05a7d..278f73dd7f 100644 --- a/internal/terraform/variables.go +++ b/internal/terraform/variables.go @@ -158,7 +158,7 @@ func (v ValueSourceType) DiagnosticLabel() string { } } -//go:generate go run golang.org/x/tools/cmd/stringer -type ValueSourceType +//go:generate go tool golang.org/x/tools/cmd/stringer -type ValueSourceType // InputValues is a map of InputValue instances. type InputValues map[string]*InputValue diff --git a/internal/tfdiags/diagnostic.go b/internal/tfdiags/diagnostic.go index c50c81890c..7977c7ca86 100644 --- a/internal/tfdiags/diagnostic.go +++ b/internal/tfdiags/diagnostic.go @@ -29,7 +29,7 @@ type Diagnostic interface { type Severity rune -//go:generate go run golang.org/x/tools/cmd/stringer -type=Severity +//go:generate go tool golang.org/x/tools/cmd/stringer -type=Severity const ( Error Severity = 'E'