Skip to content

Commit 882780b

Browse files
authored
all: Run Go 1.19 fmt (#439)
For whatever reason, the latest release of `golangci-lint` that runs in CI seems to be applying Go 1.19 fmt checks, even though we are pinned on 1.17 still. This is a quick code update to prevent CI failures from existing issues.
1 parent 46c9ee1 commit 882780b

File tree

8 files changed

+32
-34
lines changed

8 files changed

+32
-34
lines changed

datasource/data_source.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,8 @@ import "context"
77
//
88
// Data sources can optionally implement these additional concepts:
99
//
10-
// - Validation: Schema-based via tfsdk.Attribute or entire configuration
11-
// via DataSourceWithConfigValidators or DataSourceWithValidateConfig.
12-
//
10+
// - Validation: Schema-based via tfsdk.Attribute or entire configuration
11+
// via DataSourceWithConfigValidators or DataSourceWithValidateConfig.
1312
type DataSource interface {
1413
// Read is called when the provider must read data source values in
1514
// order to update state. Config values should be read from the

internal/fromproto5/providermeta.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ import (
1313
// *tfsdk.Schema. This data handling is different than Config to simplify
1414
// implementors, in that:
1515
//
16-
// - Missing Schema will return nil, rather than an error
17-
// - Missing DynamicValue will return nil typed Value, rather than an error
16+
// - Missing Schema will return nil, rather than an error
17+
// - Missing DynamicValue will return nil typed Value, rather than an error
1818
func ProviderMeta(ctx context.Context, proto5DynamicValue *tfprotov5.DynamicValue, schema *tfsdk.Schema) (*tfsdk.Config, diag.Diagnostics) {
1919
if schema == nil {
2020
return nil, nil

internal/fromproto6/providermeta.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ import (
1313
// *tfsdk.Schema. This data handling is different than Config to simplify
1414
// implementors, in that:
1515
//
16-
// - Missing Schema will return nil, rather than an error
17-
// - Missing DynamicValue will return nil typed Value, rather than an error
16+
// - Missing Schema will return nil, rather than an error
17+
// - Missing DynamicValue will return nil typed Value, rather than an error
1818
func ProviderMeta(ctx context.Context, proto6DynamicValue *tfprotov6.DynamicValue, schema *tfsdk.Schema) (*tfsdk.Config, diag.Diagnostics) {
1919
if schema == nil {
2020
return nil, nil

path/expression.go

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -20,19 +20,19 @@ import (
2020
// construct a full expression. The available traversal steps after Expression
2121
// creation are:
2222
//
23-
// - AtAnyListIndex(): Step into a list at any index
24-
// - AtAnyMapKey(): Step into a map at any key
25-
// - AtAnySetValue(): Step into a set at any attr.Value element
26-
// - AtListIndex(): Step into a list at a specific index
27-
// - AtMapKey(): Step into a map at a specific key
28-
// - AtName(): Step into an attribute or block with a specific name
29-
// - AtParent(): Step backwards one step
30-
// - AtSetValue(): Step into a set at a specific attr.Value element
23+
// - AtAnyListIndex(): Step into a list at any index
24+
// - AtAnyMapKey(): Step into a map at any key
25+
// - AtAnySetValue(): Step into a set at any attr.Value element
26+
// - AtListIndex(): Step into a list at a specific index
27+
// - AtMapKey(): Step into a map at a specific key
28+
// - AtName(): Step into an attribute or block with a specific name
29+
// - AtParent(): Step backwards one step
30+
// - AtSetValue(): Step into a set at a specific attr.Value element
3131
//
3232
// For example, to express any list element with a root list attribute named
3333
// "some_attribute":
3434
//
35-
// path.MatchRoot("some_attribute").AtAnyListIndex()
35+
// path.MatchRoot("some_attribute").AtAnyListIndex()
3636
//
3737
// An Expression is generally preferable over a Path in schema-defined
3838
// functionality that is intended to accept paths as parameters, such as

path/path.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,15 @@ import (
1313
// calls to construct a full path. The available traversal steps after Path
1414
// creation are:
1515
//
16-
// - AtListIndex(): Step into a list at a specific 0-based index
17-
// - AtMapKey(): Step into a map at a specific key
18-
// - AtName(): Step into an attribute or block with a specific name
19-
// - AtSetValue(): Step into a set at a specific attr.Value element
16+
// - AtListIndex(): Step into a list at a specific 0-based index
17+
// - AtMapKey(): Step into a map at a specific key
18+
// - AtName(): Step into an attribute or block with a specific name
19+
// - AtSetValue(): Step into a set at a specific attr.Value element
2020
//
2121
// For example, to represent the first list element with a root list attribute
2222
// named "some_attribute":
2323
//
24-
// path.MatchRoot("some_attribute").AtListIndex(0)
24+
// path.MatchRoot("some_attribute").AtListIndex(0)
2525
//
2626
// Path is used for functionality which must exactly match the underlying
2727
// schema structure and types, such as diagnostics that are intended for a

provider/provider.go

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,9 @@ import (
1111
//
1212
// Providers can optionally implement these additional concepts:
1313
//
14-
// - Validation: Schema-based via tfsdk.Attribute or entire configuration
15-
// via ProviderWithConfigValidators or ProviderWithValidateConfig.
16-
// - Meta Schema: ProviderWithMetaSchema
17-
//
14+
// - Validation: Schema-based via tfsdk.Attribute or entire configuration
15+
// via ProviderWithConfigValidators or ProviderWithValidateConfig.
16+
// - Meta Schema: ProviderWithMetaSchema
1817
type Provider interface {
1918
// GetSchema returns the schema for this provider's configuration. If
2019
// this provider has no configuration, return an empty schema.Schema.

providerserver/serve_opts.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,9 @@ func (opts ServeOpts) validateAddress(_ context.Context) error {
5959
//
6060
// Current checks which return errors:
6161
//
62-
// - If Address is not set
63-
// - Address is a valid full provider address
64-
// - ProtocolVersion, if set, is 5 or 6
62+
// - If Address is not set
63+
// - Address is a valid full provider address
64+
// - ProtocolVersion, if set, is 5 or 6
6565
func (opts ServeOpts) validate(ctx context.Context) error {
6666
if opts.Address == "" {
6767
return fmt.Errorf("Address must be provided")

resource/resource.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,12 @@ import (
99
//
1010
// Resources can optionally implement these additional concepts:
1111
//
12-
// - Import: ResourceWithImportState
13-
// - Validation: Schema-based via tfsdk.Attribute or entire configuration
14-
// via ResourceWithConfigValidators or ResourceWithValidateConfig.
15-
// - Plan Modification: Schema-based via tfsdk.Attribute or entire plan
16-
// via ResourceWithModifyPlan.
17-
// - State Upgrades: ResourceWithUpgradeState
12+
// - Import: ResourceWithImportState
13+
// - Validation: Schema-based via tfsdk.Attribute or entire configuration
14+
// via ResourceWithConfigValidators or ResourceWithValidateConfig.
15+
// - Plan Modification: Schema-based via tfsdk.Attribute or entire plan
16+
// via ResourceWithModifyPlan.
17+
// - State Upgrades: ResourceWithUpgradeState
1818
//
1919
// Although not required, it is conventional for resources to implement the
2020
// ResourceWithImportState interface.

0 commit comments

Comments
 (0)