From 1d04c2a292028019c1f248f34f1e64424ff0541d Mon Sep 17 00:00:00 2001 From: Wagner Riffel Date: Tue, 3 Sep 2019 16:34:08 -0300 Subject: [PATCH] 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 --- widgets/compose.go | 8 ++++---- 1 file 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 }