Skip to content

Commit

Permalink
refactor: use join instead of concat
Browse files Browse the repository at this point in the history
  • Loading branch information
qazwsxedckll committed Mar 6, 2024
1 parent fad7266 commit 15832ba
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion rotate_file.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package logh
import (
"fmt"
"os"
"path/filepath"
"time"
)

Expand All @@ -25,8 +26,10 @@ func NewRotateFile(directory string, basename string, rotateSize int, opts ...Op
return nil, err
}

path := filepath.Join(directory, basename)

rf := &RotateFile{
filepath: directory + "/" + basename,
filepath: path,
rotateSize: rotateSize,
rotateInterval: time.Hour * 24,
checkEveryN: 1024,
Expand Down

0 comments on commit 15832ba

Please sign in to comment.