summaryrefslogtreecommitdiff
path: root/context.go
diff options
context:
space:
mode:
authorDave Henderson <dhenderson@gmail.com>2016-01-23 21:16:13 -0500
committerDave Henderson <dhenderson@gmail.com>2016-01-23 21:16:13 -0500
commite027120266a82dcd7d37ec1d0d14873fa70742fe (patch)
tree6623e3f62dcd69d2151a6fea9e5cd9703fcb7b4a /context.go
parent6e8d894ec5de37591eee4e73bc06c74c0f3725b6 (diff)
💄 slight refactoring & adding some vague unit tests...
Signed-off-by: Dave Henderson <dhenderson@gmail.com>
Diffstat (limited to 'context.go')
-rw-r--r--context.go20
1 files changed, 20 insertions, 0 deletions
diff --git a/context.go b/context.go
new file mode 100644
index 00000000..939883ea
--- /dev/null
+++ b/context.go
@@ -0,0 +1,20 @@
+package main
+
+import (
+ "os"
+ "strings"
+)
+
+// Context for templates
+type Context struct {
+}
+
+// Env - Map environment variables for use in a template
+func (c *Context) Env() map[string]string {
+ env := make(map[string]string)
+ for _, i := range os.Environ() {
+ sep := strings.Index(i, "=")
+ env[i[0:sep]] = i[sep+1:]
+ }
+ return env
+}