use go tool to run generate commands

pull/36489/head
James Bardin 1 year ago
parent bc45d60936
commit e1485f27fc

@ -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

@ -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

@ -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

@ -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

@ -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

@ -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.

@ -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 (

@ -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 (

@ -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.

@ -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

@ -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

@ -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.

@ -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

Loading…
Cancel
Save