Skip to content
This repository has been archived by the owner on Dec 30, 2024. It is now read-only.

Commit

Permalink
fix: lint goconst (#37)
Browse files Browse the repository at this point in the history
  • Loading branch information
azrod authored Oct 23, 2023
1 parent 16b0412 commit 958c743
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 6 deletions.
4 changes: 4 additions & 0 deletions base.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,8 @@ import (
_ "github.com/iancoleman/strcase"
)

const (
errorTest = "An unexpected error was encountered trying to validate an attribute value. This is always an error in the provider. Please report the following to the provider developer:\n\n"
)

//go:generate go run template.go
4 changes: 2 additions & 2 deletions list_value_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ func TestNewListValueFrom(t *testing.T) {
diag.NewAttributeErrorDiagnostic(
path.Empty(),
"List Type Validation Error",
"An unexpected error was encountered trying to validate an attribute value. This is always an error in the provider. Please report the following to the provider developer:\n\n"+
errorTest+
"expected List value, received tftypes.Value with value: tftypes.String<\"oops\">",
),
},
Expand Down Expand Up @@ -774,7 +774,7 @@ func TestListTypeValidate(t *testing.T) {
diag.NewAttributeErrorDiagnostic(
path.Root("test"),
"List Type Validation Error",
"An unexpected error was encountered trying to validate an attribute value. This is always an error in the provider. Please report the following to the provider developer:\n\n"+
errorTest+
"expected List value, received tftypes.Value with value: tftypes.Set[tftypes.String]<tftypes.String<\"testvalue\">>",
),
},
Expand Down
4 changes: 2 additions & 2 deletions map_value_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ func TestNewMapValueFrom(t *testing.T) {
diag.NewAttributeErrorDiagnostic(
path.Empty(),
"Map Type Validation Error",
"An unexpected error was encountered trying to validate an attribute value. This is always an error in the provider. Please report the following to the provider developer:\n\n"+
errorTest+
"expected Map value, received tftypes.Value with value: tftypes.String<\"oops\">",
),
},
Expand Down Expand Up @@ -853,7 +853,7 @@ func TestMapTypeValidate(t *testing.T) {
diag.NewAttributeErrorDiagnostic(
path.Root("test"),
"Map Type Validation Error",
"An unexpected error was encountered trying to validate an attribute value. This is always an error in the provider. Please report the following to the provider developer:\n\n"+
errorTest+
"expected Map value, received tftypes.Value with value: tftypes.List[tftypes.String]<tftypes.String<\"testvalue\">>",
),
},
Expand Down
4 changes: 2 additions & 2 deletions set_value_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ package supertypes
// diag.NewAttributeErrorDiagnostic(
// path.Root("test"),
// "Set Type Validation Error",
// "An unexpected error was encountered trying to validate an attribute value. This is always an error in the provider. Please report the following to the provider developer:\n\n"+
// errorTest +
// "expected Set value, received tftypes.Value with value: tftypes.List[tftypes.String]<tftypes.String<\"testvalue\">>",
// ),
// },
Expand Down Expand Up @@ -442,7 +442,7 @@ package supertypes
// diag.NewAttributeErrorDiagnostic(
// path.Empty(),
// "Set Type Validation Error",
// "An unexpected error was encountered trying to validate an attribute value. This is always an error in the provider. Please report the following to the provider developer:\n\n"+
// errorTest +
// "expected Set value, received tftypes.Value with value: tftypes.String<\"oops\">",
// ),
// },
Expand Down

0 comments on commit 958c743

Please sign in to comment.