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

An attribute name "Y" is printed using quotes, others not #12

Closed
TLINDEN opened this issue Feb 13, 2024 · 3 comments
Closed

An attribute name "Y" is printed using quotes, others not #12

TLINDEN opened this issue Feb 13, 2024 · 3 comments
Assignees
Labels
bug Something isn't working

Comments

@TLINDEN
Copy link
Owner

TLINDEN commented Feb 13, 2024

opts := &yadu.Options{}
handler := yadu.NewHandler(os.Stdout, opts)
debuglogger := slog.New(handler)
slog.SetDefault(debuglogger)
slog.Info("ein y", "X", 1010, "Y", 3938)

Prints:

2024-02-13T06:36.56 CET INFO: ein y  
    X: 1010
    "Y": 3938

Same thing with a small "y".

WTF?

@TLINDEN
Copy link
Owner Author

TLINDEN commented Feb 13, 2024

It's a YAML bug:

p := image.Point{4, 5}
bytetree, _ := yaml.Marshal(p)
fmt.Println(string(bytetree))

prints:

x: 4
"y": 5

@TLINDEN
Copy link
Owner Author

TLINDEN commented Feb 13, 2024

Reported upstream: go-yaml/yaml#1020

@TLINDEN TLINDEN self-assigned this Feb 13, 2024
@TLINDEN TLINDEN added the bug Something isn't working label Feb 13, 2024
@TLINDEN
Copy link
Owner Author

TLINDEN commented Feb 14, 2024

Also keys are being removed, note that the key YES is missing as well.

I need to try to get rid of YAML.

I am developing configuration modules for more than 25 years (e.g. Config::General for perl) and never - NEVER! - did it come to my mind to remove entire configuration keys. Manipulating the values: yes, I even have the very same "yes|on|enabled" feature in Config::General. But the keys?! No. No. No. HELL NOOOOO!!!

And the bad new is: I can't switch to TOML either: pelletier/go-toml#932 :(

What a freaking mess.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant