zeroshade commented on code in PR #1319:
URL: https://github.com/apache/iceberg-go/pull/1319#discussion_r3482957166


##########
config/config.go:
##########
@@ -69,6 +69,15 @@ func LoadConfig(configPath string) []byte {
        return file
 }
 
+func ParseDefaultCatalog(file []byte) string {

Review Comment:
   nit: this unmarshals the same bytes that `ParseConfig` re-unmarshals on the 
very next line - two parses of the same config per run. Harmless for a CLI, but 
you could return both the `*CatalogConfig` and the default-catalog name from a 
single parse and drop this helper. Also, since it's newly exported, a one-line 
doc comment would be good.



##########
cmd/iceberg/main.go:
##########
@@ -236,7 +236,13 @@ func main() {
                }
        }
 
-       fileCfg := config.ParseConfig(config.LoadConfig(args.Config), 
args.CatalogName)
+       configData := config.LoadConfig(args.Config)
+       if !explicitFlags["catalog-name"] {

Review Comment:
   nit: this seeding path (seed from `default-catalog` when the flag is absent, 
explicit flag wins) is exactly what the PR fixes, but it isn't covered by a 
test. A small `args_test.go` case asserting `args.CatalogName` is seeded when 
`--catalog-name` is omitted (and left alone when it's explicit) would guard 
against regressions.



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