Skip to content

Commit

Permalink
correct NewProtocol6ProviderServerWithError to match the sdkv2 defini…
Browse files Browse the repository at this point in the history
…tion for ProtoV6ProviderFactories
  • Loading branch information
iwarapter committed Apr 24, 2022
1 parent d8e493d commit b5c3df6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
8 changes: 3 additions & 5 deletions tfsdk/serve.go
Expand Up @@ -63,11 +63,9 @@ func NewProtocol6ProviderServer(p Provider) func() tfprotov6.ProviderServer {
// acceptance testing helper/resource.TestCase.ProtoV6ProviderFactories.
//
// The error return is not currently used, but it may be in the future.
func NewProtocol6ProviderServerWithError(p Provider) (func() tfprotov6.ProviderServer, error) {
return func() tfprotov6.ProviderServer {
return &server{
p: p,
}
func NewProtocol6ProviderServerWithError(p Provider) (tfprotov6.ProviderServer, error) {
return &server{
p: p,
}, nil
}

Expand Down
4 changes: 1 addition & 3 deletions tfsdk/serve_test.go
Expand Up @@ -33,14 +33,12 @@ func TestNewProtocol6ProviderServer(t *testing.T) {
func TestNewProtocol6ProviderServerWithError(t *testing.T) {
provider := &testServeProvider{}

providerServerFunc, err := NewProtocol6ProviderServerWithError(provider)
providerServer, err := NewProtocol6ProviderServerWithError(provider)

if err != nil {
t.Fatalf("unexpected error creating ProviderServer: %s", err)
}

providerServer := providerServerFunc()

// Simple verification
_, err = providerServer.GetProviderSchema(context.Background(), &tfprotov6.GetProviderSchemaRequest{})

Expand Down

0 comments on commit b5c3df6

Please sign in to comment.