Forráskód Böngészése

style(sub): simplify a negated conjunction to satisfy staticcheck QF1001

golangci-lint (staticcheck QF1001) flagged the `!(a && b)` guard in
expandSegment. Rewrite it via De Morgan's law to the equivalent
`!a || !b` form so the linter passes; behavior is unchanged.
MHSanaei 18 órája
szülő
commit
a862680645
1 módosított fájl, 1 hozzáadás és 1 törlés
  1. 1 1
      internal/sub/remark_vars.go

+ 1 - 1
internal/sub/remark_vars.go

@@ -135,7 +135,7 @@ func expandSegment(seg string, ctx remarkContext) (string, bool) {
 		hasToken = true
 		token := m[2 : len(m)-2]
 		val := remarkVarValue(token, ctx)
-		if val != "" && !(unlimitedDropTokens[token] && val == unlimitedMark) {
+		if val != "" && (!unlimitedDropTokens[token] || val != unlimitedMark) {
 			hasOtherValue = true
 		}
 		return val