{"id":17775564,"url":"https://github.com/lemonnekogh/godence","last_synced_at":"2026-02-15T16:03:58.148Z","repository":{"id":48179203,"uuid":"516648829","full_name":"LemonNekoGH/godence","owner":"LemonNekoGH","description":"Cadence type 🔁 Go type","archived":false,"fork":false,"pushed_at":"2024-05-04T10:48:23.000Z","size":79,"stargazers_count":2,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-06-12T06:11:34.171Z","etag":null,"topics":["cadence","flow-blockchain","go","golang","type-casting"],"latest_commit_sha":null,"homepage":"https://pkg.go.dev/github.com/LemonNekoGH/godence","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/LemonNekoGH.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-07-22T07:12:12.000Z","updated_at":"2024-05-04T10:39:33.000Z","dependencies_parsed_at":"2024-05-04T11:31:18.558Z","dependency_job_id":"4290354f-feca-4b7b-9583-1850306e3bff","html_url":"https://github.com/LemonNekoGH/godence","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/LemonNekoGH/godence","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LemonNekoGH%2Fgodence","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LemonNekoGH%2Fgodence/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LemonNekoGH%2Fgodence/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LemonNekoGH%2Fgodence/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/LemonNekoGH","download_url":"https://codeload.github.com/LemonNekoGH/godence/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LemonNekoGH%2Fgodence/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262642956,"owners_count":23341817,"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":["cadence","flow-blockchain","go","golang","type-casting"],"created_at":"2024-10-26T21:57:53.901Z","updated_at":"2025-10-04T06:33:49.738Z","avatar_url":"https://github.com/LemonNekoGH.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Godence\n[![codecov](https://codecov.io/gh/LemonNekoGH/godence/branch/main/graph/badge.svg?token=KT1RNHTIQZ)](https://codecov.io/gh/LemonNekoGH/godence)\n![Unit Test](https://github.com/LemonNekoGH/godence/actions/workflows/main_unittest.yaml/badge.svg)\n[![Go Reference](https://pkg.go.dev/badge/github.com/LemonNekoGH/godence.svg)](https://pkg.go.dev/github.com/LemonNekoGH/godence)\n![GitHub top language](https://img.shields.io/github/languages/top/LemonNekoGH/godence)\n\n## Get Started\ninstall by go get.\n```\ngo get github.com/lemonnekogh/godence\n```\n### Convert Cadence value to Go value\nIf you have the following Cadence struct.\n```cadence\npub struct Person {\n    pub var age: UInt8\n    pub var Name: String\n}\n```\n```go\nimport \"github.com/LemonNekoGH/godence\"\n\ntype Person struct {\n    Age uint8 `godence:\"age\"` // you can specify field name in cadence by tag.\n    Name string\n}\n\nfunc main() {\n    dist := \u0026Person{}\n    // Omit: You got a Cadence value from a script or transaction. And return value named 'ret'.\n    godence.ToGo(ret, dist)\n}\n```\n### Convert Go value to Cadence value\nConvert to Cadecne Struct, Event, Resource is currently not support becase type name of Struct, Event, Resource is unpredictable.  \nCan i convert to AnyStruct and AnyResource?\n## Testing\n### Requirements\n- [Flow CLI](https://docs.onflow.org/flow-cli/): Use to emulate flow network.\n\n### Steps\n1. Start the flow emulator with command: `flow emulator`\n2. Deploy contract for testing to the emulator network: `flow deploy`\n3. Open another terminal and run `go clean -testcache \u0026\u0026 go test .`\n\n## TODO-List: Go to Cadence\n- [ ] Documents for Go to Cadence\n### Integers\n- [x] Go `int` to Cadence `Int`\n- [x] Go `int8` to Cadence `Int8`\n- [x] Go `int16` to Cadence `Int16`\n- [x] Go `int32` to Cadence `Int32`\n- [x] Go `int64` to Cadence `Int64`\n- [x] Go `*big.Int` to Cadence `Int128`\n- [x] Go `*big.Int` to Cadence `Int256`\n- [x] Go `uint` to Cadence `UInt`\n- [x] Go `uint8` to Cadence `UInt8`\n- [x] Go `uint16` to Cadence `UInt16`\n- [x] Go `uint32` to Cadence `UInt32`\n- [x] Go `uint64` to Cadence `UInt64`\n- [x] Go `*big.Int` to Cadence `UInt128`\n- [x] Go `*big.Int` to Cadence `UInt256`\n### Fixed-Point Numbers\n- [x] Go `int64` to Cadence `Fix64`\n- [x] Go `uint64` to Cadence `UFix64`\n### Other\n- [x] Go `string` to Cadence `String`\n- [x] Go `string` to Cadence `Path`\n- [x] Go `string` to Cadence `Address`\n- [x] Go `bool` to Cadence `Bool`\n- [x] Go `slice` or `array` to Cadence `Array`  \n- [ ] ~~Go `?` to Cadence `Struct`~~\n- [x] Go `string` to Cadence `Character`\n- [ ] ~~Go `?` to Cadence `Resource`~~\n- [x] Go `?` to Cadence `Dictionary`\n- [ ] ~~Go `?` to Cadence `Event`~~\n\n## TODO-List: Cadence to go\n- [ ] Documents for Cadence base type to Go.\n- [ ] Documents for Cadence complex type to Go.\n### Integers\n- [x] Cadence `Int` to Go `*big.Int`\n- [x] Cadence `Int8` to Go `int8`\n- [x] Cadence `Int16` to Go `int16`\n- [x] Cadence `Int32` to Go `int32`\n- [x] Cadence `Int64` to Go `int64`\n- [x] Cadence `Int128` to Go `*big.Int`\n- [x] Cadence `Int256` to Go `*big.Int`\n- [x] Cadence `UInt` to Go `*big.Int`\n- [x] Cadence `UInt8` to Go `uint8`\n- [x] Cadence `UInt16` to Go `uint16`\n- [x] Cadence `UInt32` to Go `uint32`\n- [x] Cadence `UInt64` to Go `uint64`\n- [x] Cadence `UInt128` to Go `*big.Int`\n- [x] Cadence `UInt256` to Go `*big.Int`\n### Fixed-Point Numbers\n- [x] Cadence `Fix64` to Go `int64`\n- [x] Cadence `UFix64` to Go `uint64`\n### Other\n- [x] Cadence `String` to Go `string`\n- [x] Cadence `Path` to Go `string`\n- [x] Cadence `Address` to Go `string` or `cadence.Address` or `[8]uint8`\n- [x] Cadence `Bool` to Go `bool`\n- [x] Cadence `Array` to Go `slice`\n- [x] Cadence `Struct` to Go `struct`\n- [x] Cadence `Character` to Go `string`\n- [x] Cadence `Resource` to Go `struct`\n- [x] Cadence `Dictionary` to Go `map`\n- [x] Cadence `Event` to Go `struct`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flemonnekogh%2Fgodence","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flemonnekogh%2Fgodence","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flemonnekogh%2Fgodence/lists"}