refactor: modernize code with go fix

This commit is contained in:
yusing
2026-02-21 13:03:21 +08:00
parent 64ffe44a2d
commit 3a7d1f8b18
12 changed files with 32 additions and 61 deletions

View File

@@ -68,8 +68,7 @@ func (r *SubstituteEnvReader) Read(p []byte) (n int, err error) {
if nMore > 0 {
incomplete = append(incomplete, more[:nMore]...)
// Check if pattern is now complete
//nolint:modernize
if idx := bytes.IndexByte(incomplete, '}'); idx >= 0 {
if found := bytes.Contains(incomplete, []byte{'}'}); found {
// Pattern complete, append the rest back to chunk
chunk = append(chunk, incomplete...)
break