summaryrefslogtreecommitdiff
path: root/pkg/variables.go
diff options
context:
space:
mode:
authorJulien Dessaux2024-05-01 16:23:08 +0200
committerJulien Dessaux2024-05-01 16:23:08 +0200
commit8b9195e3e3506d576b39a23ca646c260dfacc808 (patch)
tree1cdbdd2fb368654ef8eab702258eb5d6a90e1447 /pkg/variables.go
parentchore(gonf): fix go vet and staticcheck errors (diff)
downloadgonf-8b9195e3e3506d576b39a23ca646c260dfacc808.tar.gz
gonf-8b9195e3e3506d576b39a23ca646c260dfacc808.tar.bz2
gonf-8b9195e3e3506d576b39a23ca646c260dfacc808.zip
chore(gonf): fix errcheck and shadow errors
Diffstat (limited to 'pkg/variables.go')
-rw-r--r--pkg/variables.go5
1 files changed, 0 insertions, 5 deletions
diff --git a/pkg/variables.go b/pkg/variables.go
index bb3096d..4c9bb56 100644
--- a/pkg/variables.go
+++ b/pkg/variables.go
@@ -5,15 +5,12 @@ import (
"log/slog"
)
-// ----- Globals ---------------------------------------------------------------
var variables map[string]*VariablePromise
-// ----- Init ------------------------------------------------------------------
func init() {
variables = make(map[string]*VariablePromise)
}
-// ----- Public ----------------------------------------------------------------
func AppendVariable(name string, values ...string) *VariablePromise {
if v, ok := variables[name]; ok {
if l, ok := v.value.(*StringsListValue); ok {
@@ -66,7 +63,6 @@ type VariablePromise struct {
value Value
}
-// We want VariablePromise to satisfy the Value interface
func (s VariablePromise) Bytes() []byte {
return s.value.Bytes()
}
@@ -77,7 +73,6 @@ func (s VariablePromise) String() string {
return s.value.String()
}
-// ----- Internal --------------------------------------------------------------
func getVariable(name string) string {
if v, ok := variables[name]; ok {
return v.value.String()