Skip to content

Commit

Permalink
- F Reporter that will run first time
Browse files Browse the repository at this point in the history
  • Loading branch information
aleclerc-cio committed Dec 5, 2024
1 parent ff769f6 commit 1cf6af1
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions reporters/reporter_that_automatically_approves_the_first_time.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
package reporters

import (
"os"
)

type reporterThatAutomaticallyApprovesTheFirstTime struct{}

func NewReporterThatAutomaticallyApprovesTheFirstTime() Reporter {
return &reporterThatAutomaticallyApprovesTheFirstTime{}
}

func (s *reporterThatAutomaticallyApprovesTheFirstTime) Report(approved, received string) bool {

// If the approved file exists, just return true
if _, err := os.Stat(approved); err == nil {
return true
}

//other call the other reporter
return NewReporterThatAutomaticallyApproves().Report(approved, received)
}

0 comments on commit 1cf6af1

Please sign in to comment.