{"id":36667769,"url":"https://github.com/jn0/go-json","last_synced_at":"2026-01-12T10:36:59.029Z","repository":{"id":64304786,"uuid":"229086454","full_name":"jn0/go-json","owner":"jn0","description":"my own approach to JSON in Go","archived":false,"fork":false,"pushed_at":"2020-01-10T08:27:57.000Z","size":70,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-06-20T09:23:36.786Z","etag":null,"topics":["go","golang","golang-library","golang-package","json"],"latest_commit_sha":null,"homepage":null,"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/jn0.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":"2019-12-19T15:42:16.000Z","updated_at":"2024-06-20T09:23:36.787Z","dependencies_parsed_at":"2023-01-15T10:15:52.615Z","dependency_job_id":null,"html_url":"https://github.com/jn0/go-json","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/jn0/go-json","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jn0%2Fgo-json","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jn0%2Fgo-json/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jn0%2Fgo-json/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jn0%2Fgo-json/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jn0","download_url":"https://codeload.github.com/jn0/go-json/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jn0%2Fgo-json/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28338695,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-12T06:09:07.588Z","status":"ssl_error","status_checked_at":"2026-01-12T06:05:18.301Z","response_time":98,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5: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":["go","golang","golang-library","golang-package","json"],"created_at":"2026-01-12T10:36:58.157Z","updated_at":"2026-01-12T10:36:58.988Z","avatar_url":"https://github.com/jn0.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# go-json\n\nMy own approach to JSON in Go.\n\nSee [example](json_test.go#L21) in [`json_test.go`](json_test.go) for an idea.\n\nThere is a full (I hope) parser, but the initial idea was to *generate* JSON\nin some uniform way from different sources (yepp, sorta system monitor agent).\n\nThe point is to have special types for JSON entities that boil down to\n[`JsonValue`](json_values.go#L19) type:\n\n  - `JsonInt` (no, Ints aren't \"sorta floats\")\n  - `JsonFloat`\n  - `JsonBool`\n  - `JsonString` (all escapes, including \\uXXXX are ok on input)\n  - `JsonArray`\n  - `JsonObject`\n  - no separate type for `null`, anyone can be.\n\nAny `JsonValue` has `.Json()` method to get a `string` representation of that\nvalue suitable to send over, say, HTTP POST method.\n\nThe `JsonArray` can be `.Append()`ed and `JsonObject` has `.Insert()` method.\n\nAny other `JsonValue` considered *immutable* (one can *replace* it with `.Set()`\nmethod). The `.Set()` method accepts a \"compatible\" value or a `string`. The\n\"compatibility\" means that you can use either `float32` or `float64` as value\nfor `JsonFloat` and so on. The `string`s are `.Parse()`d, while not `.Set()` into a `JsonString`.\n\nThe `.Value()` returns \"unJSONed\" version of that `JsonValue` (type cast still needed).\n\nThe `.Equal()` compares the two `JsonValue`s to be equal and `.IsNull()` compares to zero-value.\n\n[Benchmark](json_test.go#L14) gives\n\n    goos: linux\n    goarch: amd64\n    BenchmarkAll-4   \t2000000000\t         0.17 ns/op\n    PASS\n    ok  \t_/home/jno/src/go-json\t4.935s\n\non a *Intel(R) Core(TM) i5-6600 CPU @ 3.30GHz* box.\n\ncoverage: 100% of statements\n\n# EOF #\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjn0%2Fgo-json","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjn0%2Fgo-json","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjn0%2Fgo-json/lists"}