Kaynağa Gözat

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 saat önce
ebeveyn
işleme
a862680645
1 değiştirilmiş dosya ile 1 ekleme ve 1 silme
  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
 		hasToken = true
 		token := m[2 : len(m)-2]
 		token := m[2 : len(m)-2]
 		val := remarkVarValue(token, ctx)
 		val := remarkVarValue(token, ctx)
-		if val != "" && !(unlimitedDropTokens[token] && val == unlimitedMark) {
+		if val != "" && (!unlimitedDropTokens[token] || val != unlimitedMark) {
 			hasOtherValue = true
 			hasOtherValue = true
 		}
 		}
 		return val
 		return val