rambleraptor commented on code in PR #8:
URL: https://github.com/apache/iceberg-terraform/pull/8#discussion_r2765845484


##########
internal/provider/provider.go:
##########
@@ -17,24 +17,43 @@ package provider
 
 import (
        "context"
+       "net/http"
 
+       "github.com/apache/iceberg-go/catalog"
+       "github.com/apache/iceberg-go/catalog/rest"
        "github.com/hashicorp/terraform-plugin-framework/datasource"
        "github.com/hashicorp/terraform-plugin-framework/provider"
        "github.com/hashicorp/terraform-plugin-framework/provider/schema"
        "github.com/hashicorp/terraform-plugin-framework/resource"
+       "github.com/hashicorp/terraform-plugin-framework/types"
 )
 
 var (
        _ provider.Provider = &icebergProvider{}
 )
 
 // New is a helper function to simplify provider server and testing 
implementation.
-func New() provider.Provider {
-       return &icebergProvider{}
+func New() func() provider.Provider {
+       return func() provider.Provider {
+               return &icebergProvider{}
+       }

Review Comment:
   This is kind of a personal preference thing. 
   
   The main.go file calls `providerserver.serve`, which requires a function 
that returns the provider. Most providers I've seen do this so that you're 
giving that function `provider.New()` instead of `provider.New`. The bonus is 
that you can then pass in parameters to the provider like debugging booleans or 
dev flags.
   
   The `providerserver.serve` signature means we'll have some weird function 
that returns a function.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to