Skip to content

Commit

Permalink
sync.OnceFunc is no longer supported, hencce removing
Browse files Browse the repository at this point in the history
  • Loading branch information
kneerunjun committed Jun 10, 2024
1 parent 63db678 commit a53fc43
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions log.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package utilities

import (
"os"
"sync"

log "github.com/sirupsen/logrus"
)
Expand Down Expand Up @@ -44,10 +43,9 @@ func SetUpLog() func() {
log.SetLevel(log.DebugLevel) // for development
}
return func() {
sync.OnceFunc(func() {
if f != nil {
f.Close()
}
})
if f != nil {
f.Close()
}
f = nil // so that reattempts to close such a file pointer will be blocked
}
}

0 comments on commit a53fc43

Please sign in to comment.