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: issues-unsubscr...@iceberg.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org
For additional commands, e-mail: issues-h...@iceberg.apache.org

Reply via email to