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


##########
manifest.go:
##########
@@ -951,7 +951,13 @@ func (w *ManifestWriter) meta() (map[string][]byte, error) 
{
                return nil, err
        }
 
-       specFieldsJson, err := json.Marshal(w.spec.fields)
+       specFields := w.spec.fields
+
+       if specFields == nil {
+               specFields = []PartitionField{}
+       }
+
+       specFieldsJson, err := json.Marshal(specFields)

Review Comment:
   maybe simplify?
   
   ```go
   var specFieldsJSON []byte
   if w.spec.fields == nil {
       specFieldsJSON = []byte("[]")
   } else {
       specFieldsJSON, err = json.Marshal(w.spec.fields)
       if err != nil {
           return nil, err
       }
   }
   ```
   
   Thoughts?
       



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