UNCLASSIFIED - NO CUI

Skip to content

Pastes in yamler as a drop-in customization on top of yaml.Marshal() from yaml.v3

Daniel Pritchett requested to merge djp-adds-yamler into main

General MR

Summary

Closes #279 (closed).

bbctl was using yaml.v2 for its yaml.Marshal() function. The gogru project spin-up raised a question of "Do we want to keep using 2-space indentation for the YAML we write in our Go projects? If so that's a problem because yaml.v2 doesn't allow for that customization."

This MR adds a yamler package with a yamler.Marshal() that behaves exactly like yaml.Marshal() aside from having its indentation preconfigured to two columns.

Relevant logs/screenshots

There are lots of tests failing here because our old test fixtures expected different YAML indentation.

Should we...

  • Use yamler everywhere and update the tests to match?
  • Not use yamler everywhere, and just add it to the repo for future use?

image

Linked Issue

issue

Upgrade Notices

N/A

Edited by Daniel Pritchett

Merge request reports