{"id":22285519,"url":"https://github.com/shamaton/zeroformatter","last_synced_at":"2025-07-28T22:31:19.496Z","repository":{"id":57490999,"uuid":"76113676","full_name":"shamaton/zeroformatter","owner":"shamaton","description":"golang version zeroformatter","archived":false,"fork":false,"pushed_at":"2021-03-16T11:03:48.000Z","size":48,"stargazers_count":30,"open_issues_count":0,"forks_count":5,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-06-19T01:57:36.507Z","etag":null,"topics":["go","golang","serializer","zeroformatter"],"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/shamaton.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":"2016-12-10T13:18:09.000Z","updated_at":"2024-02-23T05:07:36.000Z","dependencies_parsed_at":"2022-08-29T20:31:55.429Z","dependency_job_id":null,"html_url":"https://github.com/shamaton/zeroformatter","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shamaton%2Fzeroformatter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shamaton%2Fzeroformatter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shamaton%2Fzeroformatter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shamaton%2Fzeroformatter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/shamaton","download_url":"https://codeload.github.com/shamaton/zeroformatter/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":227961871,"owners_count":17847836,"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":["go","golang","serializer","zeroformatter"],"created_at":"2024-12-03T16:52:37.526Z","updated_at":"2024-12-03T16:52:38.181Z","avatar_url":"https://github.com/shamaton.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# zeroformatter\n\n[![GoDoc](https://godoc.org/github.com/shamaton/zeroformatter?status.svg)](https://godoc.org/github.com/shamaton/zeroformatter)\n[![Build Status](https://travis-ci.org/shamaton/zeroformatter.svg?branch=master)](https://travis-ci.org/shamaton/zeroformatter)\n[![Coverage Status](https://coveralls.io/repos/github/shamaton/zeroformatter/badge.svg)](https://coveralls.io/github/shamaton/zeroformatter)\n[![Releases](https://img.shields.io/github/release/shamaton/zeroformatter.svg)](https://github.com/shamaton/zeroformatter/releases)\n\ngolang version [zeroformatter](https://github.com/neuecc/ZeroFormatter)\n\n## Usage\n### Installation\n```sh\ngo get github.com/shamaton/zeroformatter\n```\n\n### How to use\n#### use simply\n```go\npackage main;\n\nimport (\n  \"github.com/shamaton/zeroformatter\"\n  \"log\"\n)\n\nfunc main() {\n\ttype Struct struct {\n\t\tString string\n\t}\n\th := Struct{String: \"zeroformatter\"}\n\n\td, err := zeroformatter.Serialize(h)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tr := Struct{}\n\terr = zeroformatter.Deserialize(\u0026r, d)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n}\n```\n\n#### delay\n```go\npackage main;\n\nimport (\n  \"github.com/shamaton/zeroformatter\"\n  \"log\"\n)\n\nfunc how_to_use(b []byte) {\n\ttype Struct struct {\n\t\tString string\n\t}\n\t\n\tr := Struct{}\n\tdds, _ := zeroformatter.DelayDeserialize(\u0026r, b)\n\t\n\t// by element\n\tif err := dds.DeserializeByElement(\u0026r.String); err != nil {\n\t\tlog.Fatal(err)\n\t}\n\t\n\t// or by index\n\tif err := dds.DeserializeByIndex(0); err != nil {\n\t  log.Fatal(err)\n\t}\n}\n```\n\n## Supported type \n\n### Primitive\n| C# | Go |\n| ---- | ---- |\n| Int16 | int16 |\n| Int32 | int32, int |\n| Int64 | int64 |\n| UInt16 | uint16 |\n| UInt32 | uint32, uint |\n| UInt64 | uint64 |\n| Single | float32 |\n| Double | float64 |\n| Boolean | bool |\n| Byte | uint8 |\n| SByte | int8 |\n| TimeSpan | time.Duration |\n| DateTime | time.Time |\n| String | string |\n\n### Extension within golang\nAs these types can not convert with primitive type, I defined parent classes in golang.\nThese are only wrapping. please see codes.\n\n| C# | Go |\n| ---- | ---- |\n| Char | zeroformatter.Char(rune) |\n| DateTimeOffset | zeroformatter.DateTimeOffset(time.Time) |\n\n### Array/Slice\n\n| C# | Go |\n| ---- | ---- |\n| T[], List\u003cT\u003e | []T, [N]T |\n\n### Map\n\n| C# | Go |\n| ---- | ---- |\n| Dictionary\u003cK, V\u003e | map[K]V |\n\n### Object\n\n| C# | Go |\n| ---- | ---- |\n| Struct | struct |\n\n## Not supported\n\n`type?` is not supported, because golang doen't allow null in primitve types.\n\n## License\n\nThis library is under the MIT License.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshamaton%2Fzeroformatter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fshamaton%2Fzeroformatter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshamaton%2Fzeroformatter/lists"}