Ver código fonte

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

Jordan 11 anos atrás
pai
commit
478639e56c
1 arquivos alterados com 1 adições e 2 exclusões
  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)
 }