Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds MarshalYAML for marshaling yaml #387

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

cskeeters
Copy link

When marshaling with go-yaml/yaml, numbers are output as double quoted strings. This adds a custom marshaller (MarshalYAML) that respects a new variable MarshalYAMLWithoutQuotes.

If you decide that you don't want this, I'm happy for it to just live here as a closed PR for anyone else looking for how to do this on their own.

Adds MarshalYAMLWithoutQuotes for marshaling Decimal without quotes
decimal.go Outdated Show resolved Hide resolved
decimal.go Outdated Show resolved Hide resolved
cskeeters and others added 2 commits November 11, 2024 10:30
Co-authored-by: ccoVeille <3875889+ccoVeille@users.noreply.github.com>
Co-authored-by: ccoVeille <3875889+ccoVeille@users.noreply.github.com>
Copy link

@ccoVeille ccoVeille left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One last thing

@@ -25,6 +25,7 @@ import (
"regexp"
"strconv"
"strings"
"gopkg.in/yaml.v3"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"gopkg.in/yaml.v3"
"gopkg.in/yaml.v3"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants