grim/convey

Fix state conflict.
expand-list
2017-10-03, Eric Fritz
a495ad4dc08f
Parents 857d4e84d561
Children 06eb1c85a2b5
Fix state conflict.
--- a/state/state.go Tue Oct 03 21:45:08 2017 -0500
+++ b/state/state.go Tue Oct 03 21:46:20 2017 -0500
@@ -252,3 +252,15 @@
return names
}
+
+// getName returns the name of the variable `var` if the string is of the
+// form $var or ${var}.
+func getName(env string) string {
+ env = strings.TrimSpace(env)
+
+ if strings.HasPrefix(env, "$") {
+ return strings.Trim(env[1:], "{}")
+ }
+
+ return ""
+}
\ No newline at end of file