Dont use pointer for env prefs (avoid nil)

This commit is contained in:
Mike Farah 2021-01-13 17:00:53 +11:00
parent 1a03031297
commit 947ffb6986
2 changed files with 2 additions and 2 deletions

View File

@ -183,7 +183,7 @@ func stringValue(wrapped bool) lex.Action {
func envOp(strenv bool) lex.Action { func envOp(strenv bool) lex.Action {
return func(s *lex.Scanner, m *machines.Match) (interface{}, error) { return func(s *lex.Scanner, m *machines.Match) (interface{}, error) {
value := string(m.Bytes) value := string(m.Bytes)
preferences := &envOpPreferences{} preferences := envOpPreferences{}
if strenv { if strenv {
// strenv( ) // strenv( )

View File

@ -19,7 +19,7 @@ func envOperator(d *dataTreeNavigator, matchMap *list.List, expressionNode *Expr
rawValue := os.Getenv(envName) rawValue := os.Getenv(envName)
preferences := expressionNode.Operation.Preferences.(*envOpPreferences) preferences := expressionNode.Operation.Preferences.(envOpPreferences)
var node *yaml.Node var node *yaml.Node
if preferences.StringValue { if preferences.StringValue {