{"id":36493697,"url":"https://github.com/sakura-internet/go-rison","last_synced_at":"2026-01-12T01:58:38.181Z","repository":{"id":57480845,"uuid":"119910314","full_name":"sakura-internet/go-rison","owner":"sakura-internet","description":"Go port of Rison, a data serialization format optimized for compactness in URIs.","archived":false,"fork":false,"pushed_at":"2021-05-27T00:27:59.000Z","size":75,"stargazers_count":29,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-10-05T21:20:29.363Z","etag":null,"topics":["encoding","go","golang","golang-library","rison"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sakura-internet.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-02-02T00:25:48.000Z","updated_at":"2025-03-21T09:26:24.000Z","dependencies_parsed_at":"2022-09-26T17:41:18.029Z","dependency_job_id":null,"html_url":"https://github.com/sakura-internet/go-rison","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"purl":"pkg:github/sakura-internet/go-rison","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sakura-internet%2Fgo-rison","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sakura-internet%2Fgo-rison/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sakura-internet%2Fgo-rison/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sakura-internet%2Fgo-rison/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sakura-internet","download_url":"https://codeload.github.com/sakura-internet/go-rison/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sakura-internet%2Fgo-rison/sbom","scorecard":{"id":796175,"data":{"date":"2025-08-11","repo":{"name":"github.com/sakura-internet/go-rison","commit":"7ccb216ca58a05615001d27505c6acecfa18b0f5"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.4,"checks":[{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/test.yml:11: update your workflow using https://app.stepsecurity.io/secureworkflow/sakura-internet/go-rison/test.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/test.yml:15: update your workflow using https://app.stepsecurity.io/secureworkflow/sakura-internet/go-rison/test.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/test.yml:17: update your workflow using https://app.stepsecurity.io/secureworkflow/sakura-internet/go-rison/test.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/test.yml:23: update your workflow using https://app.stepsecurity.io/secureworkflow/sakura-internet/go-rison/test.yml/master?enable=pin","Info:   0 out of   3 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   1 third-party GitHubAction dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Code-Review","score":0,"reason":"Found 0/30 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/test.yml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'","Warn: branch protection not enabled for branch 'v3'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-23T09:02:33.182Z","repository_id":57480845,"created_at":"2025-08-23T09:02:33.182Z","updated_at":"2025-08-23T09:02:33.182Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28331463,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-12T00:36:25.062Z","status":"ssl_error","status_checked_at":"2026-01-12T00:36:15.229Z","response_time":60,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["encoding","go","golang","golang-library","rison"],"created_at":"2026-01-12T01:58:36.130Z","updated_at":"2026-01-12T01:58:38.175Z","avatar_url":"https://github.com/sakura-internet.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# go-rison\n\n[![CircleCI](https://circleci.com/gh/sakura-internet/go-rison/tree/master.svg?style=shield\u0026circle-token=1e751b4de85836df4db87a736dc1e9ff208fbd12)](https://circleci.com/gh/sakura-internet/go-rison)\n[![Go Report Card](https://goreportcard.com/badge/github.com/sakura-internet/go-rison/v4)](https://goreportcard.com/report/github.com/sakura-internet/go-rison/v4)\n[![Godoc](https://godoc.org/github.com/sakura-internet/go-rison/v4?status.svg)](http://godoc.org/github.com/sakura-internet/go-rison/v4)\n[![MIT License](https://img.shields.io/badge/license-MIT-brightgreen.svg)](LICENSE)\n\nGo port of [Rison](https://github.com/Nanonid/rison).\n\nThis page describes _Rison_, a data serialization format optimized for\ncompactness in URIs. Rison is a slight variation of JSON that looks vastly\nsuperior after URI encoding. Rison still expresses exactly the same set of\ndata structures as JSON, so data can be translated back and forth without loss\nor guesswork.\n\n## Examples\n\n```go\nimport \"github.com/sakura-internet/go-rison/v4\"\n\nfunc ExampleDecode() {\n\tr := \"(id:example,str:'string',num:100,yes:!t,nil:!n,arr:!(1,2,3))\"\n\tv, _ := rison.Decode([]byte(r), rison.Rison)\n\tm := v.(map[string]interface{})\n\tfmt.Printf(\n\t\t\"id:%v, str:%v, num:%v, yes:%v, nil:%v, arr:%v\",\n\t\tm[\"id\"], m[\"str\"], m[\"num\"], m[\"yes\"], m[\"nil\"], m[\"arr\"],\n\t)\n\t// Output: id:example, str:string, num:100, yes:true, nil:\u003cnil\u003e, arr:[1 2 3]\n}\n\n// The object keys corresponding the struct fields can be\n// specified in struct tag (not \"rison\" but) \"json\".\ntype exampleStruct struct {\n\tI int64       `json:\"i\"`\n\tF float64     `json:\"f\"`\n\tS string      `json:\"s\"`\n\tB bool        `json:\"b\"`\n\tP *bool       `json:\"p\"`\n\tA []int64     `json:\"a\"`\n\tX interface{} `json:\"x\"`\n}\n\nfunc ExampleUnmarshal() {\n\tr := \"(i:1,f:2.3,s:str,b:!t,p:!n,a:!(7,8,9),x:(y:Y))\"\n\tvar v exampleStruct\n\t_ = rison.Unmarshal([]byte(r), \u0026v, rison.Rison)\n\tfmt.Printf(\"%+v\\n\", v)\n\t// Output: {I:1 F:2.3 S:str B:true P:\u003cnil\u003e A:[7 8 9] X:map[y:Y]}\n}\n\nfunc ExampleMarshal() {\n\tv := exampleStruct{\n\t\tI: 1,\n\t\tF: 2.3,\n\t\tS: \"str\",\n\t\tB: true,\n\t\tP: nil,\n\t\tA: []int64{7, 8, 9},\n\t\tX: map[string]interface{}{\"y\": \"Y\"},\n\t}\n\tr, _ := rison.Marshal(\u0026v, rison.Rison)\n\tfmt.Println(string(r))\n\t// Output: (a:!(7,8,9),b:!t,f:2.3,i:1,p:!n,s:str,x:(y:Y))\n}\n\nfunc ExampleToJSON() {\n\tr := \"!(1,2.3,str,'ing',true,nil,(a:b),!(7,8,9))\"\n\tj, _ := rison.ToJSON([]byte(r), rison.Rison)\n\tfmt.Printf(\"%s\\n\", string(j))\n\t// Output: [1,2.3,\"str\",\"ing\",\"true\",\"nil\",{\"a\":\"b\"},[7,8,9]]\n}\n\nfunc ExampleQuote() {\n\ts := \"~!*()-_.,:@$'/ \\\"#%\u0026+;\u003c=\u003e?[\\\\]^`{|}\"\n\tfmt.Println(rison.QuoteString(s))\n\t// Output: ~!*()-_.,:@$'/+%22%23%25%26%2B%3B%3C%3D%3E%3F%5B%5C%5D%5E%60%7B%7C%7D\n}\n\nfunc ExampleParseError_ErrorInLang() {\n\ttype multilingualError interface {\n\t\terror\n\t\tLangs() []string\n\t\tTranslate(lang string)\n\t}\n\n\tr := \"!(\"\n\t_, err := rison.ToJSON([]byte(r), rison.Rison)\n\tmerr := err.(multilingualError)\n\n\tlangs := merr.Langs()\n\tfmt.Println(strings.Join(langs, \", \"))\n\n\tfmt.Println(merr.Error())\n\tmerr.Translate(\"ja\")\n\tfmt.Println(merr.Error())\n\n\t// Output:\n\t// en, ja\n\t// unmatched \"!(\" (at the end of string \"!(\" -\u003e EOS)\n\t// \"!(\" が閉じていません (場所: 文字列終端: \"!(\" → EOS)\n}\n```\n\n## Descriptions\n\nThe following descriptions are some excerpts from [the original README](https://github.com/Nanonid/rison)\nand [the article](https://web.archive.org/web/20130910064110/http://mjtemplate.org/examples/rison.html):\n\n### Differences from JSON syntax\n\n  * no whitespace is permitted except inside quoted strings. \n  * almost all character escaping is left to the uri encoder. \n  * single-quotes are used for quoting, but quotes can and should be left off strings when the strings are simple identifiers. \n  * the `e+` exponent format is forbidden, since `+` is not safe in form values and the plain `e` format is equivalent. \n  * the `E`, `E+`, and `E` exponent formats are removed. \n  * object keys should be lexically sorted when encoding. the intent is to improve url cacheability. \n  * uri-safe tokens are used in place of the standard json tokens: \n    \n    |rison token|json token|meaning      |\n    |:----------|:---------|:------------|\n    |`'`        |`\"`       |string quote |\n    |`!`        |`\\`       |string escape|\n    |`(...)`    |`{...}`   |object       |\n    |`!(...)`   |`[...]`   |array        |\n    \n  * the JSON literals that look like identifiers (`true`, `false` and `null`) are represented as `!` sequences: \n    \n    |rison token|json token|\n    |:----------|:---------|\n    |`!t`       |`true`    |\n    |`!f`       |`false`   |\n    |`!n`       |`null`    |\n\nThe `!` character plays two similar but different roles, as an escape\ncharacter within strings, and as a marker for special values. This may be\nconfusing.\n\nNotice that services can distinguish Rison-encoded strings from JSON-encoded\nstrings by checking the first character. Rison structures start with `(` or\n`!(`. JSON structures start with `[` or `{`. This means that a service which\nexpects a JSON encoded object or array can accept Rison-encoded objects\nwithout loss of compatibility.\n\n### Interaction with URI %-encoding\n\nRison syntax is designed to produce strings that be legible after being [form-\nencoded](http://www.w3.org/TR/html4/interact/forms.html#form-content-type) for\nthe [query](http://gbiv.com/protocols/uri/rfc/rfc3986.html#query) section of a\nURI. None of the characters in the Rison syntax need to be URI encoded in that\ncontext, though the data itself may require URI encoding. Rison tries to be\northogonal to the %-encoding process - it just defines a string format that\nshould survive %-encoding with very little bloat. Rison quoting is only\napplied when necessary to quote characters that might otherwise be interpreted\nas special syntax.\n\nNote that most URI encoding libraries are very conservative, percent-encoding\nmany characters that are legal according to [RFC\n3986](http://gbiv.com/protocols/uri/rfc/rfc3986.html). For example,\nJavascript's builtin `encodeURIComponent()` function will still make Rison\nstrings difficult to read. The rison.js library includes a more tolerant URI\nencoder.\n\nRison uses its own quoting for strings, using the single quote (`**'**`) as a\nstring delimiter and the exclamation point (`**!**`) as the string escape\ncharacter. Both of these characters are legal in uris. Rison quoting is\nlargely inspired by Unix shell command line parsing.\n\nAll Unicode characters other than `**'**` and `**!**` are legal inside quoted\nstrings. This includes newlines and control characters. Quoting all such\ncharacters is left to the %-encoding process.\n\n### Grammar\n\nmodified from the [json.org](https://web.archive.org/web/20130910064110/http://json.org/) grammar.\n\n- _object_\n  - `()`\n  - `(` _members_ `)`\n- _members_\n  - _pair_\n  - _pair_ `,` _members_\n- _pair_\n  - _key_ `:` _value_\n- _array_\n  - `!()`\n  - `!(` _elements_ `)`\n- _elements_\n  - _value_\n  - _value_ `,` _elements_\n- _key_\n  - _id_\n  - _string_\n- _value_\n  - _id_\n  - _string_\n  - _number_\n  - _object_\n  - _array_\n  - `!t`\n  - `!f`\n  - `!n`\n    \u003cbr\u003e\n    　　　　────────────\n- _id_\n  - _idstart_\n  - _idstart_ _idchars_\n- _idchars_\n  - _idchar_\n  - _idchar_ _idchars_\n- _idchar_\n  - any alphanumeric ASCII character\n  - any ASCII character from the set `-` `_` `.` `/` `~`\n  - any non-ASCII Unicode character\n- _idstart_\n  - any _idchar_ not in `-`, _digit_\n    \u003cbr\u003e\n    　　　　────────────\n- _string_\n  - `''`\n  - `'` _strchars_ `'`\n- _strchars_\n  - _strchar_\n  - _strchar_ _strchars_\n- _strchar_\n  - any Unicode character except ASCII `'` and `!`\n  - `!!`\n  - `!'`\n    \u003cbr\u003e\n    　　　　────────────\n- _number_\n  - _int_\n  - _int_ _frac_\n  - _int_ _exp_\n  - _int_ _frac_ _exp_\n- _int_\n  - _digit_\n  - _digit1-9_ _digits_\n  - `-` digit\n  - `-` digit1-9 digits\n- _frac_\n  - `.` _digits_\n- _exp_\n  - _e_ _digits_\n- _digits_\n  - _digit_\n  - _digit_ _digits_\n- _e_\n  - `e`\n  - `e-`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsakura-internet%2Fgo-rison","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsakura-internet%2Fgo-rison","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsakura-internet%2Fgo-rison/lists"}