Skip to content

Commit 202706e

Browse files
committed
- r simplify test log checker
1 parent 8cb587d commit 202706e

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

internal/log/approved_file_log.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,9 @@ func GetApprovedFileLoggerInstance() *approvedFileLog {
3434
return instance
3535
}
3636

37-
func checkForRunningSubsectionOfTests() bool {
37+
func isFullTestRun() bool {
3838
runFlag := flag.Lookup("test.run")
39-
return runFlag != nil && runFlag.Value.String() != ""
39+
return runFlag == nil || runFlag.Value.String() == ""
4040
}
4141

4242
func (l approvedFileLog) initializeFile() {
@@ -45,7 +45,7 @@ func (l approvedFileLog) initializeFile() {
4545

4646
fileFlags := os.O_RDWR | os.O_CREATE | os.O_TRUNC
4747

48-
if checkForRunningSubsectionOfTests() {
48+
if !isFullTestRun() {
4949
fileFlags = os.O_APPEND
5050
}
5151

0 commit comments

Comments
 (0)