过期删除文件

This commit is contained in:
Yun
2024-06-26 17:41:17 +08:00
parent 5bf701a22b
commit 119b82930e
2 changed files with 21 additions and 7 deletions
+2
View File
@@ -21,6 +21,7 @@ import (
// 需要实现io.Writer接口
type Logger struct {
ctx context.Context
filePath *sync.Map // filePath
mu *sync.Mutex
option loggerOption
@@ -44,6 +45,7 @@ func NewLogger(ctx context.Context, opts ...Option) *Logger {
}
l := &Logger{
ctx: ctx,
filePath: &sync.Map{},
mu: &sync.Mutex{},
option: opt,