8000 go-yaml is archived, migrate to goccy/go-yaml · Issue #3667 · 99designs/gqlgen · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

go-yaml is archived, migrate to goccy/go-yaml #3667

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

Open
sonatard opened this issue Apr 15, 2025 · 3 comments
Open

go-yaml is archived, migrate to goccy/go-yaml #3667

sonatard opened this issue Apr 15, 2025 · 3 comments
Labels
help wanted Extra attention is needed

Comments

@sonatard
Copy link
Contributor
sonatard commented Apr 15, 2025

go-yaml/yaml is archived. migrate to goccy/go-yaml

migrate in gqlgenc.
Yamashou/gqlgenc#277

@sonatard sonatard changed the title go-yaml is deprecated go-yaml is archived Apr 15, 2025
@StevenACoffman
Copy link
Collaborator

Yeah, I'm not entirely sure.
I got burned by https://github.com/goccy/go-json, so I would need to have some independent stress test or fuzz test assessment that showed that it wasn't a big mistake. I've used https://github.com/braydonk/yaml and https://github.com/google/yamlfmt and they have worked pretty well.

@sonatard
Copy link
Contributor Author

goccy/go-json and goccy/go-yaml follow very different design philosophies.

goccy/go-json aims to accelerate JSON handling while preserving the encoding/json-compatible API. To achieve that speed-up it relies heavily on the unsafe package, which makes running it in production quite risky.
https://github.com/search?q=repo%3Agoccy%2Fgo-json%20unsafe&type=code

goccy/go-yaml was created to solve the issue of go-yaml/yaml.
https://github.com/goccy/go-yaml?tab=readme-ov-file#why-a-new-library
It does not use the unsafe package, so the risk is much lower.
https://github.com/search?q=repo%3Agoccy%2Fgo-yaml%20unsafe&type=code

YAML Test Suite consists of 402 cases in total, of which gopkg.in/yaml.v3 passes 295. In addition to passing all those test cases, goccy/go-yaml successfully passes nearly 60 additional test cases ( 2024/12/15 )

In addition, goccy/go-yaml passes more YAML test suites than go-yaml/yaml.

And goccy/go-yaml is already used in several large projects.
https://github.com/goccy/go-yaml/wiki/Users

That said, I agree it’s prudent to evaluate other YAML packages as well, so opening a window to collect alternative candidates sounds like a good plan.

@StevenACoffman StevenACoffman changed the title go-yaml is archived go-yaml is archived, migrate to goccy/go-yaml May 2, 2025
@StevenACoffman StevenACoffman added the help wanted Extra attention is needed label May 6, 2025
@StevenACoffman
Copy link
Collaborator

@sonatard Ok, I took goccy/go-yaml for a spin, and it looks pretty great! Thanks for suggesting we switch gqlgen to it!
I'm only sad that goccy/go-yaml doesn't expose the internal formatting package so I can't use it for all the things I use https://github.com/google/yamlfmt for (yet).

I'm not able to devote the time to move gqlgen over to it right now, but I would love to have any PRs if you or someone else is able to devote the time to that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants
0