Skip to content

Commit

Permalink
fix: time.Compare not exists on macOS
Browse files Browse the repository at this point in the history
  • Loading branch information
huskar-t committed Sep 18, 2024
1 parent 634ce2f commit 1e1cf50
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 1 deletion.
22 changes: 22 additions & 0 deletions .github/workflows/mac.yml
Original file line number Diff line number Diff line change
@@ -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

2 changes: 1 addition & 1 deletion rotatelogs.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down

0 comments on commit 1e1cf50

Please sign in to comment.