All Projects → GoBike → envflag

GoBike / envflag

Licence: MIT license
Simple environment-variables extension to Golang flag.

Programming Languages

go
31211 projects - #10 most used programming language

Projects that are alternatives of or similar to envflag

Envy
Envy automatically exposes environment variables for all of your Go flags
Stars: ✭ 150 (+614.29%)
Mutual labels:  environment-variables, flags
flagga
An extensible Go library for handling program configuration using flags.
Stars: ✭ 28 (+33.33%)
Mutual labels:  environment-variables, flags
Heroku Config
[Utility] Push and pull heroku environment variables to your local env
Stars: ✭ 207 (+885.71%)
Mutual labels:  environment-variables
Management
Management Endpoints used to allow insight into your applications
Stars: ✭ 31 (+47.62%)
Mutual labels:  environment-variables
ini
📝 Go INI config management. support multi file load, data override merge. parse ENV variable, parse variable reference. Dotenv file parse and loader. INI配置读取管理,支持多文件加载,数据覆盖合并, 解析ENV变量, 解析变量引用。DotEnv 解析加载
Stars: ✭ 72 (+242.86%)
Mutual labels:  environment-variables
Werdlists
⌨️ Wordlists, Dictionaries and Other Data Sets for Writing Software Security Test Cases
Stars: ✭ 216 (+928.57%)
Mutual labels:  environment-variables
tfenv
Transform environment variables for use with Terraform (e.g. `HOSTNAME` ⇨ `TF_VAR_hostname`)
Stars: ✭ 120 (+471.43%)
Mutual labels:  environment-variables
Env Var
Verification, sanitization, and type coercion for environment variables in Node.js
Stars: ✭ 201 (+857.14%)
Mutual labels:  environment-variables
pytest-envvars
Pytest plugin to validate use of envvars on your tests
Stars: ✭ 21 (+0%)
Mutual labels:  environment-variables
dotenvy
Speed up your production sites by ditching .env for key/value variable pairs as Apache, Nginx, and shell equivalents
Stars: ✭ 31 (+47.62%)
Mutual labels:  environment-variables
envs
Easy access of environment variables from Python with support for typing (ex. booleans, strings, lists, tuples, integers, floats, and dicts). Now with CLI settings file converter.
Stars: ✭ 25 (+19.05%)
Mutual labels:  environment-variables
Go Env
a golang library to manage environment variables
Stars: ✭ 247 (+1076.19%)
Mutual labels:  environment-variables
Now Env
Use `now.json` environment variables while developing
Stars: ✭ 219 (+942.86%)
Mutual labels:  environment-variables
country-flags
A small package to convert a country code to the corresponding country flag emoji
Stars: ✭ 27 (+28.57%)
Mutual labels:  flags
Environ Config
Python Application Configuration With Environment Variables
Stars: ✭ 210 (+900%)
Mutual labels:  environment-variables
fastHistory
A python tool connected to your terminal to store important commands, search them in a fast way and automatically paste them into your terminal
Stars: ✭ 24 (+14.29%)
Mutual labels:  flags
Config
🛠 A configuration library for Go that parses environment variables, JSON files, and reloads automatically on SIGHUP
Stars: ✭ 203 (+866.67%)
Mutual labels:  environment-variables
Konfig
Simple config properties API for Kotlin
Stars: ✭ 249 (+1085.71%)
Mutual labels:  environment-variables
envsafe
🔒 Makes sure you don't accidentally deploy apps with missing or invalid environment variables.
Stars: ✭ 705 (+3257.14%)
Mutual labels:  environment-variables
cleye
👁‍🗨 cleye — The intuitive & typed CLI development tool for Node.js
Stars: ✭ 235 (+1019.05%)
Mutual labels:  flags

envflag

Go Report Card GoDoc

Simple environment extension to Golang flag.

Goals

  • Extends Golang flag with environment-variables.
  • Clear precendence: default < environment-variable < cli.
  • Adheres to 12-factor-app.

Installation

$ go get github.com/gobike/envflag

Usage

Create main.go

package main

import (
    "fmt"
    "flag"
    "github.com/gobike/envflag"
)

func main() {
    var (
        times int
    )

    flag.IntVar(&times, "f-times", 1, "this is #")
    envflag.Parse() 

    fmt.Println(times)
}

Run with default.

$ go run main.go 
1 #output

Run with environment-variable set.

$ F_TIMES=100 go run main.go 
100 #output

Run with cli set.

$ F_TIMES=100 go run main.go --f-times=10 
10 #output, environment-variable is ignored
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].