Skip to content

Commit

Permalink
Fix metadata rendering issue (#1018)
Browse files Browse the repository at this point in the history
### Description

Prior to this commit, the printed metadata was wrapped/formatted
incorrectly when running `mcap list metadata`. This commit fixes it by
removing the pretty json format – making the metadata column print only
1 line.
  • Loading branch information
narasaka authored Nov 16, 2023
1 parent 7ae75b2 commit 3633a57
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions go/cli/mcap/cmd/metadata.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,15 +54,11 @@ func printMetadata(w io.Writer, r io.ReadSeeker, info *mcap.Info) error {
if err != nil {
return fmt.Errorf("failed to marshal metadata to JSON: %w", err)
}
prettyJSON, err := utils.PrettyJSON(jsonSerialized)
if err != nil {
return fmt.Errorf("failed to pretty JSON: %w", err)
}
rows = append(rows, []string{
idx.Name,
fmt.Sprintf("%d", idx.Offset),
fmt.Sprintf("%d", idx.Length),
prettyJSON,
string(jsonSerialized),
})
}
utils.FormatTable(w, rows)
Expand Down

0 comments on commit 3633a57

Please sign in to comment.