소스 검색

Use filepath.Base() instead of path.Base() to provide cross-platform functionality

Jordan 11 년 전
부모
커밋
478639e56c
1개의 변경된 파일1개의 추가작업 그리고 2개의 파일을 삭제
  1. 1 2
      email.go

+ 1 - 2
email.go

@@ -14,7 +14,6 @@ import (
 	"net/smtp"
 	"net/textproto"
 	"os"
-	"path"
 	"path/filepath"
 	"strings"
 	"time"
@@ -80,7 +79,7 @@ func (e *Email) AttachFile(filename string) (a *Attachment, err error) {
 		return
 	}
 	ct := mime.TypeByExtension(filepath.Ext(filename))
-	basename := path.Base(filename)
+	basename := filepath.Base(filename)
 	return e.Attach(f, basename, ct)
 }