Skip to content

Commit

Permalink
Adopt future go yaml line wrapping behavior
Browse files Browse the repository at this point in the history
Closes brancz#7

In v3, go yaml will not wrap lines by default: adopt this now to avoid
churn later and return to the previous default used in v2.3.0 which was
un-defaulted in v2.4.0 back to pre v2.3.0 behavior.
  • Loading branch information
underrun committed Jul 8, 2021
1 parent 202f76b commit d659561
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions main.go
Expand Up @@ -6,13 +6,17 @@ import (
"log"
"os"

goyaml "gopkg.in/yaml.v2"
"github.com/ghodss/yaml"
)

func main() {
yamltojson := flag.Bool("yamltojson", false, "Convert yaml to json instead of the default json to yaml.")
flag.Parse()

// Don't wrap long lines
goyaml.FutureLineWrap()

inBytes, err := ioutil.ReadAll(os.Stdin)
if err != nil {
log.Fatal(err)
Expand Down

0 comments on commit d659561

Please sign in to comment.