@@ -42,19 +42,19 @@ var commonErrorPatterns = []string{
4242}
4343
4444type cfg struct {
45- Container string
46- Timeout time.Duration
47- IgnoreCase bool
48- Retry int
49- Patterns []string
50- NotExpected []string
45+ Container string
46+ Timeout time.Duration
47+ IgnoreCase bool
48+ Retry int
49+ Patterns []string
50+ NotExpected []string
5151 NotExpectedExclude []string
52- InvertMatch bool
53- DefaultErrors bool
52+ InvertMatch bool
53+ DefaultErrors bool
5454
55- compiled []* regexp.Regexp
55+ compiled []* regexp.Regexp
5656 notExpectedCompiled []* regexp.Regexp
57- highlighter func (string ) string
57+ highlighter func (string ) string
5858}
5959
6060func Command () * cobra.Command {
@@ -152,7 +152,7 @@ func (c *cfg) retryableRun(ctx context.Context) error {
152152 scanner := bufio .NewScanner (strings .NewReader (stdoutBuf .String ()))
153153 for scanner .Scan () {
154154 line := scanner .Text ()
155-
155+
156156 // Check expected patterns
157157 for i , re := range c .compiled {
158158 if re .MatchString (line ) {
@@ -164,7 +164,7 @@ func (c *cfg) retryableRun(ctx context.Context) error {
164164 break
165165 }
166166 }
167-
167+
168168 // Check not-expected patterns
169169 for _ , re := range c .notExpectedCompiled {
170170 if re .MatchString (line ) {
@@ -180,7 +180,7 @@ func (c *cfg) retryableRun(ctx context.Context) error {
180180 scanner = bufio .NewScanner (strings .NewReader (stderrBuf .String ()))
181181 for scanner .Scan () {
182182 line := scanner .Text ()
183-
183+
184184 // Check expected patterns
185185 for i , re := range c .compiled {
186186 if re .MatchString (line ) {
@@ -191,7 +191,7 @@ func (c *cfg) retryableRun(ctx context.Context) error {
191191 matchedPatterns [i ] = true
192192 }
193193 }
194-
194+
195195 // Check not-expected patterns
196196 for _ , re := range c .notExpectedCompiled {
197197 if re .MatchString (line ) {
@@ -206,7 +206,7 @@ func (c *cfg) retryableRun(ctx context.Context) error {
206206 // Print all matches at the end
207207 nmatches := len (matches )
208208 nNotExpected := len (notExpectedMatches )
209-
209+
210210 clog .InfoContextf (ctx , "found %d expected matches in container %s" , nmatches , c .Container )
211211 for i , m := range matches {
212212 clog .InfoContextf (ctx , "-- [%d/%d] expected in %s: %s" , i + 1 , nmatches , m .Container , m .Text )
@@ -258,7 +258,7 @@ func (c *cfg) prerun(_ context.Context, args []string) error {
258258 // Start with all default patterns
259259 patterns := make ([]string , len (commonErrorPatterns ))
260260 copy (patterns , commonErrorPatterns )
261-
261+
262262 // Remove excluded patterns
263263 for _ , exclude := range c .NotExpectedExclude {
264264 filtered := []string {}
@@ -269,7 +269,7 @@ func (c *cfg) prerun(_ context.Context, args []string) error {
269269 }
270270 patterns = filtered
271271 }
272-
272+
273273 // Add defaults (after exclusions) to not-expected patterns
274274 c .NotExpected = append (c .NotExpected , patterns ... )
275275 }
0 commit comments