mirror of
https://github.com/mikefarah/yq.git
synced 2026-06-30 17:21:42 +00:00
Apply De Morgan's law to tomlKey condition to fix staticcheck QF1001
Agent-Logs-Url: https://github.com/mikefarah/yq/sessions/eeab0316-309f-418f-b357-11bbacffb471 Co-authored-by: mikefarah <1151925+mikefarah@users.noreply.github.com>
This commit is contained in:
parent
c7aa0cec1e
commit
9b1bdfec70
@ -74,7 +74,7 @@ func (te *tomlEncoder) CanHandleAliases() bool {
|
||||
// digits, underscores, and dashes.
|
||||
func tomlKey(key string) string {
|
||||
for _, r := range key {
|
||||
if !((r >= 'A' && r <= 'Z') || (r >= 'a' && r <= 'z') || (r >= '0' && r <= '9') || r == '_' || r == '-') {
|
||||
if (r < 'A' || r > 'Z') && (r < 'a' || r > 'z') && (r < '0' || r > '9') && r != '_' && r != '-' {
|
||||
return fmt.Sprintf("%q", key)
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user