diff --git a/.github/workflows/mac.yml b/.github/workflows/mac.yml new file mode 100644 index 0000000..49e9f81 --- /dev/null +++ b/.github/workflows/mac.yml @@ -0,0 +1,22 @@ +name: GO_MACOS +on: [push, pull_request] + +jobs: + build: + runs-on: macos-latest + strategy: + matrix: + go: [ '1.17', 'stable' ] + name: Go ${{ matrix.go }} test + steps: + - name: checkout TDengine by pr + uses: actions/checkout@v4 + + - uses: actions/setup-go@v5 + with: + go-version: ${{ matrix.go }} + + - name: test + id: test + run: sudo go test -v --count=1 + diff --git a/rotatelogs.go b/rotatelogs.go index a4e9f8f..9bfdd2b 100644 --- a/rotatelogs.go +++ b/rotatelogs.go @@ -506,7 +506,7 @@ func (rl *RotateLogs) rotateClean() error { continue } toCompress = append(toCompress, p) - if rl.maxAge > 0 && fi.ModTime().Compare(cutoff) <= 0 { + if rl.maxAge > 0 && !fi.ModTime().After(cutoff) { m[fl] = p outDateFiles = append(outDateFiles, fl) }