darkrockmountain / gomail

GoMail is a powerful library for sending emails via multiple providers, including SMTP, Gmail API, Microsoft Graph API, SendGrid, AWS SES, Mailgun, Mandrill, Postmark, and SparkPost. Supporting attachments, plain text, and HTML content, it simplifies email integration for developers with easy setup and robust functionalities.
https://darkrockmountain.com
Apache License 2.0
4 stars 1 forks source link

[BUG] - Deprecated use of io/ioutil.ReadFile #19

Closed DarkRockMountain-admin closed 2 months ago

DarkRockMountain-admin commented 4 months ago

Describe the bug The package is using the deprecated io/ioutil.ReadFile function in email_sender.go. This function is deprecated as of Go 1.16.

To Reproduce Steps to reproduce the behavior:

  1. Inspect the email_sender.go file.
  2. Locate the usage of io/ioutil.ReadFile.

Expected behavior The code should use os.ReadFile instead of the deprecated io/ioutil.ReadFile.

Screenshots N/A

Desktop (please complete the following information):

Smartphone (please complete the following information): N/A

Additional context The deprecated function should be replaced with os.ReadFile for future compatibility and to adhere to best practices.

Code Reference

// Deprecated usage in email_sender.go:
// Deprecated: As of Go 1.16, this function simply calls [os.ReadFile].
func ReadFile(filename string) ([]byte, error) {
    return os.ReadFile(filename)
}

This reference explains the deprecation and recommends using os.ReadFile.