func (t *MailTestSuite) Attachment(name string) Attachment {
	path := t.base + string(os.PathSeparator) + DataPath + string(os.PathSeparator) + name
	file, err := ioutil.ReadFile(path)
	if err != nil {
		t.Fail("error getting attachment with the path: "+path, err)
	}
	return Attachment{
		Filename: name,
		Bytes:    file,
	}
}
Returns a PNG attachment for testing.
package mail
import (
	"errors"
	"fmt"
	"github.com/stretchr/testify/suite"
	"io/ioutil"
	"os"
	"testing"
)
type MailTestSuite struct {
	suite.Suite
	base string
}
func TestMail(t *testing.T) {
	suite.Run(t, new(MailTestSuite))
}
func (t *MailTestSuite) SetupSuite() {
	wd, err := os.Getwd()
	t.NoError(err)
	t.base = wd
}
const (
	DataPath = "testdata"
	PNGName = "gopher.png"
	JPGName = "gopher.jpg"
	SVGName = "gopher.svg"
)