{"id":24083328,"url":"https://github.com/mitranim/gt","last_synced_at":"2025-02-27T01:17:17.918Z","repository":{"id":57627642,"uuid":"403592494","full_name":"mitranim/gt","owner":"mitranim","description":"Short for \"Go Types\". Important data types missing from the Go standard library.","archived":false,"fork":false,"pushed_at":"2023-08-30T15:18:58.000Z","size":300,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-02-24T06:44:38.632Z","etag":null,"topics":["data","date","datetime","go","golang","interval","json","null-safety","sql","time","url","uuid"],"latest_commit_sha":null,"homepage":"https://pkg.go.dev/github.com/mitranim/gt","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"unlicense","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mitranim.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-09-06T11:13:30.000Z","updated_at":"2024-08-25T17:23:05.000Z","dependencies_parsed_at":"2022-09-26T20:11:46.478Z","dependency_job_id":null,"html_url":"https://github.com/mitranim/gt","commit_stats":null,"previous_names":[],"tags_count":20,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mitranim%2Fgt","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mitranim%2Fgt/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mitranim%2Fgt/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mitranim%2Fgt/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mitranim","download_url":"https://codeload.github.com/mitranim/gt/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240959115,"owners_count":19884911,"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":["data","date","datetime","go","golang","interval","json","null-safety","sql","time","url","uuid"],"created_at":"2025-01-09T23:56:24.426Z","updated_at":"2025-02-27T01:17:17.881Z","avatar_url":"https://github.com/mitranim.png","language":"Go","readme":"## Overview\n\nShort for \"**G**o **T**ypes\". Important data types missing from the Go standard library. Tiny and dependency-free.\n\n* `NullDate`: civil date without time, where zero value is empty/null.\n* `NullTime`: time where zero value is empty/null.\n* `Interval`: ISO 8601 duration, corresponds to Postgres `interval`.\n* `NullInterval`: interval where zero value is empty/null.\n* `Uuid`: simple implementation of UUID version 4.\n* `NullUuid`: UUID where zero value is empty/null.\n* `NullInt`: int where zero value is empty/null.\n* `NullUint`: uint where zero value is empty/null.\n* `NullFloat`: float where zero value is empty/null.\n* `NullUrl`: actually usable variant of `url.URL`, used by value rather than pointer, where zero value is empty/null.\n* `Ter`: nullable boolean (ternary), more usable and efficient than either `*bool` or `sql.NullBool`.\n\nAPI docs: https://pkg.go.dev/github.com/mitranim/gt\n\nImportant features:\n\nAll types implement all relevant encoding/decoding interfaces for text, JSON, and SQL. Types can be seamlessly used for database fields, JSON fields, and so on, without the need for manual conversions.\n\nAll \"nullable\" `gt` types are type aliases of \"normal\" types, where the zero value is considered \"null\". This eliminates some invalid states at the type system level.\n\nFor example, for nullable DB enums, `gt.NullString` is a better choice than `*string` or `sql.NullString`, because it doesn't have the often-invalid state of non-null `\"\"`. Eliminating invalid states eliminates bugs. Similarly, `gt.NullTime` is a better choice than `time.Time`, `*time.Time` or `sql.NullTime`. It avoids the hassle of pointers or manual JSON conversions, while preventing your from accidentally inserting `0001-01-01`.\n\n## License\n\nhttps://unlicense.org\n\n## Misc\n\nI'm receptive to suggestions. If this library _almost_ satisfies you but needs changes, open an issue or chat me up. Contacts: https://mitranim.com/#contacts\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmitranim%2Fgt","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmitranim%2Fgt","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmitranim%2Fgt/lists"}