{"id":16027482,"url":"https://github.com/followtheprocess/pointer","last_synced_at":"2025-09-03T07:36:42.837Z","repository":{"id":164521825,"uuid":"639973211","full_name":"FollowTheProcess/pointer","owner":"FollowTheProcess","description":"Work fearlessly with pointers in Go","archived":false,"fork":false,"pushed_at":"2025-05-18T09:31:52.000Z","size":45,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-05-18T10:29:27.578Z","etag":null,"topics":[],"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/FollowTheProcess.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,"zenodo":null}},"created_at":"2023-05-12T16:55:22.000Z","updated_at":"2025-05-18T09:31:55.000Z","dependencies_parsed_at":"2025-04-15T05:42:53.225Z","dependency_job_id":"e96d028b-ff51-4f28-b9cf-03130645f4e8","html_url":"https://github.com/FollowTheProcess/pointer","commit_stats":{"total_commits":24,"total_committers":2,"mean_commits":12.0,"dds":"0.33333333333333337","last_synced_commit":"5a3e6855564380d76f57472cba218f61c5fbacc6"},"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/FollowTheProcess/pointer","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FollowTheProcess%2Fpointer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FollowTheProcess%2Fpointer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FollowTheProcess%2Fpointer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FollowTheProcess%2Fpointer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/FollowTheProcess","download_url":"https://codeload.github.com/FollowTheProcess/pointer/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FollowTheProcess%2Fpointer/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":273409610,"owners_count":25100446,"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","status":"online","status_checked_at":"2025-09-03T02:00:09.631Z","response_time":76,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":[],"created_at":"2024-10-08T20:21:49.158Z","updated_at":"2025-09-03T07:36:42.806Z","avatar_url":"https://github.com/FollowTheProcess.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Pointer\n\n[![License](https://img.shields.io/github/license/FollowTheProcess/pointer)](https://github.com/FollowTheProcess/pointer)\n[![Go Reference](https://pkg.go.dev/badge/github.com/FollowTheProcess/pointer.svg)](https://pkg.go.dev/github.com/FollowTheProcess/pointer)\n[![Go Report Card](https://goreportcard.com/badge/github.com/FollowTheProcess/pointer)](https://goreportcard.com/report/github.com/FollowTheProcess/pointer)\n[![GitHub](https://img.shields.io/github/v/release/FollowTheProcess/pointer?logo=github\u0026sort=semver)](https://github.com/FollowTheProcess/pointer)\n[![CI](https://github.com/FollowTheProcess/pointer/workflows/CI/badge.svg)](https://github.com/FollowTheProcess/pointer/actions?query=workflow%3ACI)\n[![codecov](https://codecov.io/gh/FollowTheProcess/pointer/branch/main/graph/badge.svg)](https://codecov.io/gh/FollowTheProcess/pointer)\n\n***Work fearlessly with pointers in Go***\n\n## Project Description\n\n`package pointer` is a *tiny*, simple and obvious library helping you to always work safely with pointers and avoid the dreaded `nil pointer dereference` 🚀\n\n## Installation\n\nTo use this project in your code:\n\n```shell\ngo get github.com/FollowTheProcess/pointer@latest\n```\n\nAnd then simply:\n\n```go\nimport \"github.com/FollowTheProcess/pointer\"\n```\n\n## Quickstart\n\nUsing `pointer` is so easy, you already know how to do it!\n\n```go\nimport (\n    \"fmt\"\n\n    \"github.com/FollowTheProcess/pointer\"\n)\n\nfunc main() {\n    var s *string // nil\n\n    // More code here, you've forgotten `s` is nil by now!\n    // but pointer has you covered!\n    str := pointer.Or(s, \"hello\")\n\n    fmt.Println(str) // \"hello\"\n\n    // We just want the zero value if it's nil\n    fmt.Println(pointer.OrDefault(s)) // \"\"\n}\n```\n\n`pointer.Or` will return the pointer it's passed in **only** if it's not nil! Otherwise you'll get back the value you provided.\n\nIf you just want the zero value instead, use `pointer.OrDefault`\n\n### Credits\n\nThis package was created with [copier] and the [FollowTheProcess/go_copier] project template.\n\n[copier]: https://copier.readthedocs.io/en/stable/\n[FollowTheProcess/go_copier]: https://github.com/FollowTheProcess/go_copier\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffollowtheprocess%2Fpointer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffollowtheprocess%2Fpointer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffollowtheprocess%2Fpointer/lists"}