mirror of
https://github.com/usememos/memos.git
synced 2025-06-05 22:09:59 +02:00
chore: fix misuse of package path instead of filepath.path (#2684)
As stated by https://pkg.go.dev/path, "path" is mainly for URLs, "path.filepath" for file systems
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
package telegram
|
||||
|
||||
import (
|
||||
"path"
|
||||
"path/filepath"
|
||||
|
||||
"go.uber.org/zap"
|
||||
|
||||
@@ -27,7 +27,7 @@ func (b Attachment) GetMimeType() string {
|
||||
return b.MimeType
|
||||
}
|
||||
|
||||
mime, ok := mimeTypes[path.Ext(b.FileName)]
|
||||
mime, ok := mimeTypes[filepath.Ext(b.FileName)]
|
||||
if !ok {
|
||||
// Handle unknown file extension
|
||||
log.Warn("Unknown file type for ", zap.String("filename", b.FileName))
|
||||
|
Reference in New Issue
Block a user