Skip to content

Commit 53e9f93

Browse files
authored
fix: 应该调用filepath.Ext的地方调用了path.Ext (#1696)
* fix: 应该调用filepath.Ext的地方调用了path.Ext * fix: typo
1 parent c226a94 commit 53e9f93

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

server/utils/timer/timed_task.go

+4-4
Original file line numberDiff line numberDiff line change
@@ -169,19 +169,19 @@ func (t *timer) FindCronList() map[string]*taskManager {
169169
}
170170

171171
// StartCron 开始任务
172-
func (t *timer) StartCron(cromName string) {
172+
func (t *timer) StartCron(cronName string) {
173173
t.Lock()
174174
defer t.Unlock()
175-
if v, ok := t.cronList[cromName]; ok {
175+
if v, ok := t.cronList[cronName]; ok {
176176
v.corn.Start()
177177
}
178178
}
179179

180180
// StopCron 停止任务
181-
func (t *timer) StopCron(cromName string) {
181+
func (t *timer) StopCron(cronName string) {
182182
t.Lock()
183183
defer t.Unlock()
184-
if v, ok := t.cronList[cromName]; ok {
184+
if v, ok := t.cronList[cronName]; ok {
185185
v.corn.Stop()
186186
}
187187
}

server/utils/upload/local.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import (
55
"io"
66
"mime/multipart"
77
"os"
8-
"path"
8+
"path/filepath"
99
"strings"
1010
"time"
1111

@@ -27,7 +27,7 @@ type Local struct{}
2727

2828
func (*Local) UploadFile(file *multipart.FileHeader) (string, string, error) {
2929
// 读取文件后缀
30-
ext := path.Ext(file.Filename)
30+
ext := filepath.Ext(file.Filename)
3131
// 读取文件名并加密
3232
name := strings.TrimSuffix(file.Filename, ext)
3333
name = utils.MD5V([]byte(name))

0 commit comments

Comments
 (0)