diff options
| author | Jeff Carr <[email protected]> | 2025-10-24 13:06:36 -0500 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2025-10-24 13:06:36 -0500 |
| commit | 31e2be4b6f0388975244a0ee6a5929bdf9be2149 (patch) | |
| tree | 930bfc19fbc368e53015222873a49c6851f6359b | |
| parent | 7c4e482a19b0af3eac87b43f71a594518ffb3c57 (diff) | |
ENV vs env isn't worth the fight. lower case is lame for this thoughv0.0.7
| -rw-r--r-- | README.md | 20 | ||||
| -rw-r--r-- | SetGlobal.go | 2 | ||||
| -rw-r--r-- | appname.go | 2 | ||||
| -rw-r--r-- | exit.go | 2 | ||||
| -rw-r--r-- | formatENV.go | 2 | ||||
| -rw-r--r-- | generate.go | 2 | ||||
| -rw-r--r-- | init.go | 10 | ||||
| -rw-r--r-- | key.proto | 2 | ||||
| -rw-r--r-- | modCache.go | 2 | ||||
| -rw-r--r-- | panic.go | 2 | ||||
| -rw-r--r-- | save.go | 2 | ||||
| -rw-r--r-- | structs.go | 2 | ||||
| -rw-r--r-- | table.go | 2 | ||||
| -rw-r--r-- | verbose.go | 2 |
14 files changed, 27 insertions, 27 deletions
@@ -1,20 +1,20 @@ -# ENV Library +# env Library -Works like sh ENV, but is file based. +Works like sh env, but is file based. ## Design goals -* backwards compatible: saved files are compatible with bash ENV syntax +* backwards compatible: saved files are compatible with bash env syntax * simple: only string key=value pairs * concurrent: use file locks -* global: ENV functions can be called from anywhere -* dynamic: automaticly detect ENV changes by the file mtime +* global: env functions can be called from anywhere +* dynamic: automaticly detect env changes by the file mtime ## Theory of Operation -The core philosophy of this library is to standardize ENV in a new way +The core philosophy of this library is to standardize env in a new way -ENV configuration files are loaded in this defined order: +env configuration files are loaded in this defined order: 1. /usr/share/doc/foo/foo.env # upstream application defaults 2. /etc/foo/foo.env # OS distribution defaults @@ -24,11 +24,11 @@ ENV configuration files are loaded in this defined order: ## function examples ``` -key := ENV.Get("APIKEY") +key := env.Get("APIKEY") -if ENV.True("verbose") { +if env.True("verbose") { fmt.Println("worked") } -ENV.Set("LocalPort", "8080") +env.Set("LocalPort", "8080") ``` diff --git a/SetGlobal.go b/SetGlobal.go index f255dcd..8b19325 100644 --- a/SetGlobal.go +++ b/SetGlobal.go @@ -1,4 +1,4 @@ -package ENV +package env import "errors" @@ -1,4 +1,4 @@ -package ENV +package env import ( "errors" @@ -1,4 +1,4 @@ -package ENV +package env import "os" diff --git a/formatENV.go b/formatENV.go index 1b4c519..ea2931c 100644 --- a/formatENV.go +++ b/formatENV.go @@ -1,4 +1,4 @@ -package ENV +package env import ( "errors" diff --git a/generate.go b/generate.go index 62f55ea..12ba344 100644 --- a/generate.go +++ b/generate.go @@ -1,4 +1,4 @@ -package ENV +package env // 'make generate' will call this // @@ -1,4 +1,4 @@ -package ENV +package env import ( "os" @@ -26,12 +26,12 @@ func Init(appname, version, buildtime string, fromargv []string, goodFunc func(s loadAppENV() - SetGlobal("lib/ENV", "APPNAME", APPNAME) - SetGlobal("lib/ENV", "VERSION", VERSION) - SetGlobal("lib/ENV", "BUILDTIME", BUILDTIME) + SetGlobal("lib/env", "APPNAME", APPNAME) + SetGlobal("lib/env", "VERSION", VERSION) + SetGlobal("lib/env", "BUILDTIME", BUILDTIME) } -// if it exists, loads ~/.config/<appname>/<appname>.ENV +// if it exists, loads ~/.config/<appname>/<appname>.env func loadAppENV() error { saveMu.Lock() saveMu.Unlock() @@ -2,7 +2,7 @@ syntax = "proto3"; -package ENV; +package env; message Key { // string var = 1; // ENV var name `autogenpb:unique` `autogenpb:sort` diff --git a/modCache.go b/modCache.go index d02e046..dceeed9 100644 --- a/modCache.go +++ b/modCache.go @@ -4,7 +4,7 @@ // Parallel cache. // This file is copied from cmd/go/internal/par. -package ENV +package env import ( "sync" @@ -1,4 +1,4 @@ -package ENV +package env func GetPanic(flag string) string { saveMu.Lock() @@ -1,4 +1,4 @@ -package ENV +package env import ( "os" @@ -1,4 +1,4 @@ -package ENV +package env import ( "errors" @@ -1,6 +1,6 @@ // Copyright 2025 WIT.COM Inc Licensed GPL 3.0 -package ENV +package env import ( "fmt" @@ -1,4 +1,4 @@ -package ENV +package env // this is an experiment at this point to // see how this turns out |
