Skip to content

Commit

Permalink
variables.go: Fix lint, add travis go 1.11 build
Browse files Browse the repository at this point in the history
  • Loading branch information
xor-gate committed Sep 19, 2018
1 parent af93be5 commit fab6cc0
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions variables.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
"text/template"
)

// Variables
// Variables mapping
type Variables map[string]string

// DefaultVariables creates a Variables object populated from Default* constants (e.g InstallPrefixVar set to DefaultInstallPrefix)
Expand All @@ -24,20 +24,20 @@ func DefaultVariables() Variables {
return v
}

// SetVar sets a variable for use with config file
// Set sets a variable for use with config file
func (v Variables) Set(key, val string) {
v[key] = val
}

// GetVar gets a variable by key
// Get gets a variable by key
func (v Variables) Get(key string) string {
if val, ok := v[key]; ok {
return val
}
return ""
}

// GetVarWithPrefix gets a variable and appends INSTALLPREFIX when the value doesn't start with "/"
// GetWithPrefix gets a variable and appends INSTALLPREFIX when the value doesn't start with "/"
func (v Variables) GetWithPrefix(key string) string {
val := v.Get(key)
if val == "" {
Expand Down

0 comments on commit fab6cc0

Please sign in to comment.