{"id":15546543,"url":"https://github.com/aleksi/pointer","last_synced_at":"2025-05-15T23:06:41.366Z","repository":{"id":18124292,"uuid":"21202247","full_name":"AlekSi/pointer","owner":"AlekSi","description":"Go package pointer provides helpers to get pointers to values of built-in types.","archived":false,"fork":false,"pushed_at":"2022-11-01T18:36:01.000Z","size":23,"stargazers_count":222,"open_issues_count":2,"forks_count":19,"subscribers_count":7,"default_branch":"main","last_synced_at":"2025-05-15T23:06:26.851Z","etag":null,"topics":["hacktoberfest"],"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/AlekSi.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":"2014-06-25T12:23:26.000Z","updated_at":"2025-04-04T16:25:25.000Z","dependencies_parsed_at":"2022-06-29T21:24:25.284Z","dependency_job_id":null,"html_url":"https://github.com/AlekSi/pointer","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AlekSi%2Fpointer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AlekSi%2Fpointer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AlekSi%2Fpointer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AlekSi%2Fpointer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AlekSi","download_url":"https://codeload.github.com/AlekSi/pointer/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254436948,"owners_count":22070947,"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":["hacktoberfest"],"created_at":"2024-10-02T13:02:36.434Z","updated_at":"2025-05-15T23:06:41.030Z","avatar_url":"https://github.com/AlekSi.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# pointer\n\n[![Go Reference](https://pkg.go.dev/badge/github.com/AlekSi/pointer.svg)](https://pkg.go.dev/github.com/AlekSi/pointer)\n\nGo package `pointer` provides helpers to convert between pointers and values of built-in\n(and, with Go 1.18+ generics, of any) types.\n\n```\ngo get github.com/AlekSi/pointer\n```\n\nAPI is stable. [Documentation](https://pkg.go.dev/github.com/AlekSi/pointer).\n\n```go\npackage motivationalexample\n\nimport (\n\t\"encoding/json\"\n\n\t\"github.com/AlekSi/pointer\"\n)\n\nconst (\n\tdefaultName = \"some name\"\n)\n\n// Stuff contains optional fields.\ntype Stuff struct {\n\tName    *string\n\tComment *string\n\tValue   *int64\n\tTime    *time.Time\n}\n\n// SomeStuff makes some JSON-encoded stuff.\nfunc SomeStuff() (data []byte, err error) {\n\treturn json.Marshal(\u0026Stuff{\n\t\tName:    pointer.ToString(defaultName),                                   // can't say \u0026defaultName\n\t\tComment: pointer.ToString(\"not yet\"),                                     // can't say \u0026\"not yet\"\n\t\tValue:   pointer.ToInt64(42),                                             // can't say \u002642 or \u0026int64(42)\n\t\tTime:    pointer.ToTime(time.Date(2014, 6, 25, 12, 24, 40, 0, time.UTC)), // can't say \u0026time.Date(…)\n\t})\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faleksi%2Fpointer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faleksi%2Fpointer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faleksi%2Fpointer/lists"}