mirror of
https://github.com/mikefarah/yq.git
synced 2026-09-07 02:48:27 +08:00
Replace gopkg.in/op/go-logging.v1 with log/slog (#2635)
* Initial plan * Replace gopkg.in/op/go-logging.v1 with log/slog Co-authored-by: mikefarah <1151925+mikefarah@users.noreply.github.com> Agent-Logs-Url: https://github.com/mikefarah/yq/sessions/aa9c12f4-21b9-4633-9868-6b56585b247f --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: mikefarah <1151925+mikefarah@users.noreply.github.com>
This commit is contained in:
co-authored by
mikefarah
copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
parent
11f4dc1a03
commit
7d8d3ab902
@@ -21,7 +21,7 @@ func envOperator(_ *dataTreeNavigator, context Context, expressionNode *Expressi
|
||||
return Context{}, fmt.Errorf("env operations have been disabled")
|
||||
}
|
||||
envName := expressionNode.Operation.CandidateNode.Value
|
||||
log.Debug("EnvOperator, env name:", envName)
|
||||
log.Debugf("EnvOperator, env name: %v", envName)
|
||||
|
||||
rawValue := os.Getenv(envName)
|
||||
|
||||
@@ -49,9 +49,9 @@ func envOperator(_ *dataTreeNavigator, context Context, expressionNode *Expressi
|
||||
}
|
||||
|
||||
}
|
||||
log.Debug("ENV tag", node.Tag)
|
||||
log.Debug("ENV value", node.Value)
|
||||
log.Debug("ENV Kind", node.Kind)
|
||||
log.Debugf("ENV tag: %v", node.Tag)
|
||||
log.Debugf("ENV value: %v", node.Value)
|
||||
log.Debugf("ENV Kind: %v", node.Kind)
|
||||
|
||||
return context.SingleChildContext(node), nil
|
||||
}
|
||||
@@ -78,7 +78,7 @@ func envsubstOperator(_ *dataTreeNavigator, context Context, expressionNode *Exp
|
||||
for el := context.MatchingNodes.Front(); el != nil; el = el.Next() {
|
||||
node := el.Value.(*CandidateNode)
|
||||
if node.Tag != "!!str" {
|
||||
log.Warning("EnvSubstOperator, env name:", node.Tag, node.Value)
|
||||
log.Warningf("EnvSubstOperator, env name: %v %v", node.Tag, node.Value)
|
||||
return Context{}, fmt.Errorf("cannot substitute with %v, can only substitute strings. Hint: Most often you'll want to use '|=' over '=' for this operation", node.Tag)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user