{"id":19956941,"url":"https://github.com/zhooravell/go-env","last_synced_at":"2025-07-30T15:20:33.284Z","repository":{"id":57498175,"uuid":"190390603","full_name":"zhooravell/go-env","owner":"zhooravell","description":"Go package to load environment variables from .env","archived":false,"fork":false,"pushed_at":"2019-06-17T14:32:34.000Z","size":18,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-01-12T07:12:03.742Z","etag":null,"topics":["dotenv","dotenv-parser","env","environment-variables","go","golang","golang-library","golang-package"],"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/zhooravell.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":"2019-06-05T12:30:00.000Z","updated_at":"2020-01-14T15:11:19.000Z","dependencies_parsed_at":"2022-08-28T17:12:12.433Z","dependency_job_id":null,"html_url":"https://github.com/zhooravell/go-env","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zhooravell%2Fgo-env","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zhooravell%2Fgo-env/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zhooravell%2Fgo-env/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zhooravell%2Fgo-env/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zhooravell","download_url":"https://codeload.github.com/zhooravell/go-env/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241389131,"owners_count":19955106,"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":["dotenv","dotenv-parser","env","environment-variables","go","golang","golang-library","golang-package"],"created_at":"2024-11-13T01:36:01.807Z","updated_at":"2025-03-01T15:45:02.130Z","avatar_url":"https://github.com/zhooravell.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"Go env\n======\n\u003e GoLang package to load environment variables from `.env`.\n\n[![Go Report Card][goreportcard-image]][goreportcard-image] [![codecov][scrutinizer-image]][scrutinizer-link] [![License][license-image]][license-link] [![Build Status][travis-image]][travis-link] [![codecov][codecov-image]][codecov-link] \n## Installation\nNative\n```bash\n$ go get github.com/zhooravell/go-env\n```\ndep\n```bash\n$ dep ensure -add github.com/zhooravell/go-env\n```\n## Usage\n\n```go\npackage main\n\nimport (\n\t\"github.com/zhooravell/go-env\"\n\t\"log\"\n)\n\nfunc init()  {\n\tif err := env.Load(); err != nil {\n\t\tlog.Fatal(err)\n\t}\n}\n\nfunc main()  {\n\ts := env.GetVar(\"ENV_STRING\", \"\")\n\tb, _ := env.GetBoolVar(\"ENV_BOOL\", false)\n\ti, _ := env.GetIntVar(\"ENV_INT\", 0)\n\ti8, _ := env.GetInt8Var(\"ENV_INT8\", 0)\n\ti16, _ := env.GetInt16Var(\"ENV_INT16\", 0)\n\ti32, _ := env.GetInt32Var(\"ENV_INT32\", 0)\n\ti64, _ := env.GetInt32Var(\"ENV_INT64\", 0)\n\tf32, _ := env.GetFloat32Var(\"ENV_FLOAT32\", 0)\n\tf64, _ := env.GetFloat64Var(\"ENV_FLOAT64\", 0)\n\n\tlog.Println(\"string: \", s)\n\tlog.Println(\"bool: \", b)\n\tlog.Println(\"int: \", i)\n\tlog.Println(\"int8: \", i8)\n\tlog.Println(\"int16: \", i16)\n\tlog.Println(\"int32: \", i32)\n\tlog.Println(\"int64: \", i64)\n\tlog.Println(\"float32: \", f32)\n\tlog.Println(\"float64: \", f64)\n}\n```\n\n## Source(s)\n\n* [environment variable wiki](https://en.wikipedia.org/wiki/Environment_variable)\n* [os](https://golang.org/pkg/os/)\n* [strconv](https://golang.org/pkg/strconv/)\n* [strings](https://golang.org/pkg/strings/)\n* [regexp](https://golang.org/pkg/regexp/)\n\n[license-link]: https://github.com/zhooravell/go-env/blob/master/LICENSE\n[license-image]: https://img.shields.io/dub/l/vibe-d.svg\n\n[travis-link]: https://travis-ci.com/zhooravell/go-env\n[travis-image]: https://travis-ci.com/zhooravell/go-env.svg?branch=master\n\n[codecov-link]: https://codecov.io/gh/zhooravell/go-env\n[codecov-image]: https://codecov.io/gh/zhooravell/go-env/branch/master/graph/badge.svg\n\n[scrutinizer-link]: https://scrutinizer-ci.com/g/zhooravell/go-env/?branch=master\n[scrutinizer-image]: https://scrutinizer-ci.com/g/zhooravell/go-env/badges/quality-score.png?b=master\n\n[goreportcard-link]: https://goreportcard.com/report/github.com/zhooravell/go-env\n[goreportcard-image]: https://goreportcard.com/badge/github.com/zhooravell/go-env","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzhooravell%2Fgo-env","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzhooravell%2Fgo-env","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzhooravell%2Fgo-env/lists"}