{"id":22409785,"url":"https://github.com/go-faster/yaml","last_synced_at":"2025-07-31T20:31:18.554Z","repository":{"id":44342341,"uuid":"512150878","full_name":"go-faster/yaml","owner":"go-faster","description":"Fork of go-yaml/yaml for go-faster needs","archived":false,"fork":false,"pushed_at":"2024-03-04T08:30:05.000Z","size":2070,"stargazers_count":8,"open_issues_count":5,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-06-19T05:54:59.091Z","etag":null,"topics":["faster","go","golang","parser","yaml"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/go-faster.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE-APACHE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":"AUTHORS","dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-07-09T09:56:28.000Z","updated_at":"2024-05-08T05:22:59.000Z","dependencies_parsed_at":"2024-06-19T05:35:43.415Z","dependency_job_id":null,"html_url":"https://github.com/go-faster/yaml","commit_stats":null,"previous_names":["go-faster/yamlx"],"tags_count":21,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/go-faster%2Fyaml","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/go-faster%2Fyaml/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/go-faster%2Fyaml/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/go-faster%2Fyaml/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/go-faster","download_url":"https://codeload.github.com/go-faster/yaml/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":228295594,"owners_count":17897596,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["faster","go","golang","parser","yaml"],"created_at":"2024-12-05T12:09:43.881Z","updated_at":"2024-12-05T12:09:44.483Z","avatar_url":"https://github.com/go-faster.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# yaml [![](https://img.shields.io/badge/go-pkg-00ADD8)](https://pkg.go.dev/github.com/go-faster/yaml#section-documentation) [![](https://img.shields.io/codecov/c/github/go-faster/yaml?label=cover)](https://codecov.io/gh/go-faster/yaml) [![beta](https://img.shields.io/badge/-beta-yellow)](https://go-faster.org/docs/projects/status#beta)\n\n`yaml` is a YAML parser for Go. It is a fork of [`yaml`](https://github.com/go-yaml/yaml) that adds some features\nto make it more useful for `go-faster` purposes, including better error reporting and performance.\n\n## Compatibility\n\nThe yaml package supports most of YAML 1.2, but preserves some behavior\nfrom 1.1 for backwards compatibility.\n\nSpecifically, as of v3 of the yaml package:\n\n- YAML 1.1 bools (_yes/no, on/off_) are supported as long as they are being\n  decoded into a typed bool value. Otherwise they behave as a string. Booleans\n  in YAML 1.2 are _true/false_ only.\n- Octals encode and decode as _0777_ per YAML 1.1, rather than _0o777_\n  as specified in YAML 1.2, because most parsers still use the old format.\n  Octals in the  _0o777_ format are supported though, so new files work.\n- Does not support base-60 floats. These are gone from YAML 1.2, and were\n  actually never supported by this package as it's clearly a poor choice.\n\nand offers backwards\ncompatibility with YAML 1.1 in some cases.\n1.2, including support for\nanchors, tags, map merging, etc. Multi-document unmarshaling is not yet\nimplemented, and base-60 floats from YAML 1.1 are purposefully not\nsupported since they're a poor design and are gone in YAML 1.2.\n\n## Installation and usage\n\nThe import path for the package is `github.com/go-faster/yaml`.\n\nTo install it, run:\n\n    go get github.com/go-faster/yaml\n\n## API stability\n\nUnlike the original library, this module is not guaranteed to be stable.\n\n\n## Example\n\n```Go\npackage main\n\nimport (\n\t\"fmt\"\n\t\"log\"\n\n\t\"github.com/go-faster/yaml\"\n)\n\nvar data = `\na: Easy!\nb:\n  c: 2\n  d: [3, 4]\n`\n\n// Note: struct fields must be public in order for unmarshal to\n// correctly populate the data.\ntype T struct {\n\tA string\n\tB struct {\n\t\tRenamedC int   `yaml:\"c\"`\n\t\tD        []int `yaml:\",flow\"`\n\t}\n}\n\nfunc main() {\n\tt := T{}\n\n\terr := yaml.Unmarshal([]byte(data), \u0026t)\n\tif err != nil {\n\t\tlog.Fatalf(\"error: %v\", err)\n\t}\n\tfmt.Printf(\"--- t:\\n%v\\n\\n\", t)\n\n\td, err := yaml.Marshal(\u0026t)\n\tif err != nil {\n\t\tlog.Fatalf(\"error: %v\", err)\n\t}\n\tfmt.Printf(\"--- t dump:\\n%s\\n\\n\", string(d))\n\n\tm := make(map[interface{}]interface{})\n\n\terr = yaml.Unmarshal([]byte(data), \u0026m)\n\tif err != nil {\n\t\tlog.Fatalf(\"error: %v\", err)\n\t}\n\tfmt.Printf(\"--- m:\\n%v\\n\\n\", m)\n\n\td, err = yaml.Marshal(\u0026m)\n\tif err != nil {\n\t\tlog.Fatalf(\"error: %v\", err)\n\t}\n\tfmt.Printf(\"--- m dump:\\n%s\\n\\n\", string(d))\n}\n```\n\nThis example will generate the following output:\n\n```\n--- t:\n{Easy! {2 [3 4]}}\n\n--- t dump:\na: Easy!\nb:\n  c: 2\n  d: [3, 4]\n\n\n--- m:\nmap[a:Easy! b:map[c:2 d:[3 4]]]\n\n--- m dump:\na: Easy!\nb:\n  c: 2\n  d:\n  - 3\n  - 4\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgo-faster%2Fyaml","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgo-faster%2Fyaml","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgo-faster%2Fyaml/lists"}