{"id":22093882,"url":"https://github.com/ieee0824/getenv","last_synced_at":"2025-07-24T20:33:01.507Z","repository":{"id":49469238,"uuid":"93719054","full_name":"ieee0824/getenv","owner":"ieee0824","description":"getenv package is assign default value if env var is empty.","archived":false,"fork":false,"pushed_at":"2025-04-09T07:07:18.000Z","size":31,"stargazers_count":7,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-09T08:22:45.024Z","etag":null,"topics":["default-value","environment","getenv","golang"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ieee0824.png","metadata":{"files":{"readme":"README.jp.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":"2017-06-08T07:18:25.000Z","updated_at":"2025-04-09T07:05:15.000Z","dependencies_parsed_at":"2024-06-19T14:58:12.930Z","dependency_job_id":"1c2047c4-413b-42c1-8cb9-5278e1047a43","html_url":"https://github.com/ieee0824/getenv","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/ieee0824/getenv","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ieee0824%2Fgetenv","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ieee0824%2Fgetenv/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ieee0824%2Fgetenv/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ieee0824%2Fgetenv/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ieee0824","download_url":"https://codeload.github.com/ieee0824/getenv/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ieee0824%2Fgetenv/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266902035,"owners_count":24003602,"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-07-24T02:00:09.469Z","response_time":99,"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":["default-value","environment","getenv","golang"],"created_at":"2024-12-01T03:16:05.937Z","updated_at":"2025-07-24T20:33:01.215Z","avatar_url":"https://github.com/ieee0824.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# getenv\n\n[English](./README.md) | 日本語\n\nGo言語で環境変数を取得時に任意の型に変換して取得することができます.  \nまた環境変数に値が存在しないときはデフォルト値を設定しておいて取得することができます.\n\n[![CircleCI](https://circleci.com/gh/ieee0824/getenv.svg?style=shield)](https://circleci.com/gh/ieee0824/getenv)\n\n# example\n\n\n```\nimport (\n\t\"fmt\"\n\t\"github.com/ieee0824/getenv\"\n\t\"time\"\n\t\"os\"\n)\n\n\nfmt.Println(getenv.Duration(\"ANY_ENV\"))\nfmt.Println(getenv.Duration(\"ANY_ENV\", 60))\nfmt.Println(getenv.Duration(\"ANY_ENV\",\"120s\"))\nfmt.Println(getenv.Duration(\"ANY_ENV\", 60 * time.Second))\nfmt.Println(getenv.Duration(\"ANY_ENV\", \"1h30m20s\"))\n\nos.Setenv(\"ANY_ENV\", \"60h\")\nfmt.Println(getenv.Duration(\"ANY_ENV\"))\nfmt.Println(getenv.Duration(\"ANY_ENV\", 60))\nfmt.Println(getenv.Duration(\"ANY_ENV\",\"120s\"))\nfmt.Println(getenv.Duration(\"ANY_ENV\", 60 * time.Second))\nfmt.Println(getenv.Duration(\"ANY_ENV\", \"1h30m20s\"))\n\nos.Setenv(\"ANY_ENV\", \"60h\")\nfmt.Println(getenv.Duration(\"ANY_ENV\"))\nfmt.Println(getenv.Duration(\"ANY_ENV\", 60))\nfmt.Println(getenv.Duration(\"ANY_ENV\",\"120s\"))\nfmt.Println(getenv.Duration(\"ANY_ENV\", 60 * time.Second))\nfmt.Println(getenv.Duration(\"ANY_ENV\", \"1h30m20s\"))\n```\n\n```\n0s\n1m0s\n2m0s\n1m0s\n1h30m20s\n60h0m0s\n60h0m0s\n60h0m0s\n60h0m0s\n60h0m0s\n18h12m16s\n18h12m16s\n18h12m16s\n18h12m16s\n18h12m16s\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fieee0824%2Fgetenv","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fieee0824%2Fgetenv","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fieee0824%2Fgetenv/lists"}