Explorar o código

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

Jordan %!s(int64=11) %!d(string=hai) anos
pai
achega
478639e56c
Modificáronse 1 ficheiros con 1 adicións e 2 borrados
  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)
 }