{"id":13410445,"url":"https://github.com/codingconcepts/env","last_synced_at":"2025-12-27T04:54:02.215Z","repository":{"id":57488936,"uuid":"94368499","full_name":"codingconcepts/env","owner":"codingconcepts","description":"Tag-based environment configuration for structs","archived":false,"fork":false,"pushed_at":"2024-06-18T13:34:07.000Z","size":49,"stargazers_count":114,"open_issues_count":2,"forks_count":14,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-12-06T22:09:59.549Z","etag":null,"topics":[],"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/codingconcepts.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}},"created_at":"2017-06-14T20:01:55.000Z","updated_at":"2024-11-13T01:51:18.000Z","dependencies_parsed_at":"2024-06-18T15:18:33.559Z","dependency_job_id":"d142899b-3b5d-428b-91a1-04f471a04490","html_url":"https://github.com/codingconcepts/env","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codingconcepts%2Fenv","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codingconcepts%2Fenv/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codingconcepts%2Fenv/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codingconcepts%2Fenv/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/codingconcepts","download_url":"https://codeload.github.com/codingconcepts/env/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243610208,"owners_count":20318921,"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":[],"created_at":"2024-07-30T20:01:06.959Z","updated_at":"2025-12-27T04:54:02.146Z","avatar_url":"https://github.com/codingconcepts.png","language":"Go","readme":"# env\nTag-based environment configuration for structs.\n\n[![Godoc](https://godoc.org/github.com/codingconcepts/env?status.svg)](https://godoc.org/github.com/codingconcepts/env)\n[![Build Status](https://travis-ci.org/codingconcepts/env.svg?branch=master)](https://travis-ci.org/codingconcepts/env)\n[![Go Report Card](https://goreportcard.com/badge/github.com/codingconcepts/env)](https://goreportcard.com/report/github.com/codingconcepts/env)\n\n## Installation\n\n``` bash\n$ go get -u github.com/codingconcepts/env\n```\n\n## Usage\n\n``` go\npackage main\n\nimport (\n\t\"fmt\"\n\t\"log\"\n\t\"time\"\n\n\t\"github.com/codingconcepts/env\"\n)\n\ntype config struct {\n\tSecret            []byte        `env:\"SECRET\" required:\"true\"`\n\tRegion            string        `env:\"REGION\"`\n\tPort              int           `env:\"PORT\" required:\"true\"`\n\tPeers             []string      `env:\"PEERS\"` // you can use `delimiter` tag to specify separator, for example `delimiter:\" \"` \n\tConnectionTimeout time.Duration `env:\"TIMEOUT\" default:\"10s\"`\n}\n\nfunc main() {\n\tc := config{}\n\tif err := env.Set(\u0026c); err != nil {\n\t\tlog.Fatal(err)\n\t}\n\n\t...\n}\n```\n\n``` bash\n$ ID=1 SECRET=shh PORT=1234 PEERS=localhost:1235,localhost:1236 TIMEOUT=5s go run main.go\n```\n\n## Supported field types\n\n- `bool` and `[]bool`\n- `string` and `[]string`\n- `[]byte`\n- `int`, `int8`, `int16`, `int32`, `int64`, `[]int`, `[]int8`, `[]int16`, `[]int32`, and `[]int64`\n- `uint`, `uint8`, `uint16`, `uint32`, `uint64`, `[]uint`, `[]uint8`, `[]uint16`, `[]uint32`, and `[]uint64`\n- `float32`, `float64`, `[]float32`, and `[]float64`\n- `time.Duration` and `[]time.Duration`\n","funding_links":[],"categories":["Command Line","Build Automation","\u003cspan id=\"命令行-command-line\"\u003e命令行 Command Line\u003c/span\u003e","命令行","命令行工具### 标准 CLI`用于创建一个标准命令行应用程序的库`","命令行工具"],"sub_categories":["Standard CLI","标准CLI","标准 CLI"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodingconcepts%2Fenv","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcodingconcepts%2Fenv","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodingconcepts%2Fenv/lists"}