about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorWagner Riffel <wgrriffel@gmail.com>2019-09-03 16:34:08 -0300
committerDrew DeVault <sir@cmpwn.com>2019-09-04 16:30:57 -1000
commit1d04c2a292028019c1f248f34f1e64424ff0541d (patch)
treec6ed7521f052ff9515beef71314c42645fccffeb
parent6338194c4eeb4670ffc5421281d3a28319eee9a1 (diff)
downloadaerc-1d04c2a292028019c1f248f34f1e64424ff0541d.tar.gz
widgets: rewrite references to os.SET_SEEK to io.SeekStart
Os.SET_SEEK is deprecated, it's recommended to use contants from io
package

Signed-off-by: Wagner Riffel <wgrriffel@gmail.com>
-rw-r--r--widgets/compose.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/widgets/compose.go b/widgets/compose.go
index a49a947..bd4301a 100644
--- a/widgets/compose.go
+++ b/widgets/compose.go
@@ -131,10 +131,10 @@ func buildComposeHeader(layout HeaderLayout, defaults map[string]string) (
 // Note: this does not reload the editor. You must call this before the first
 // Draw() call.
 func (c *Composer) SetContents(reader io.Reader) *Composer {
-	c.email.Seek(0, os.SEEK_SET)
+	c.email.Seek(0, io.SeekStart)
 	io.Copy(c.email, reader)
 	c.email.Sync()
-	c.email.Seek(0, os.SEEK_SET)
+	c.email.Seek(0, io.SeekStart)
 	return c
 }
 
@@ -248,7 +248,7 @@ func (c *Composer) PrepareHeader() (*mail.Header, []string, error) {
 		header = reader.Header
 		defer reader.Close()
 	} else {
-		c.email.Seek(0, os.SEEK_SET)
+		c.email.Seek(0, io.SeekStart)
 	}
 	// Update headers
 	mhdr := (*message.Header)(&header.Header)
@@ -336,7 +336,7 @@ func (c *Composer) WriteMessage(header *mail.Header, writer io.Writer) error {
 		body = part.Body
 		defer reader.Close()
 	} else {
-		c.email.Seek(0, os.SEEK_SET)
+		c.email.Seek(0, io.SeekStart)
 		body = c.email
 	}