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>
This commit is contained in:
parent
6338194c4e
commit
1d04c2a292
1 changed files with 4 additions and 4 deletions
|
@ -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
|
// Note: this does not reload the editor. You must call this before the first
|
||||||
// Draw() call.
|
// Draw() call.
|
||||||
func (c *Composer) SetContents(reader io.Reader) *Composer {
|
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)
|
io.Copy(c.email, reader)
|
||||||
c.email.Sync()
|
c.email.Sync()
|
||||||
c.email.Seek(0, os.SEEK_SET)
|
c.email.Seek(0, io.SeekStart)
|
||||||
return c
|
return c
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -248,7 +248,7 @@ func (c *Composer) PrepareHeader() (*mail.Header, []string, error) {
|
||||||
header = reader.Header
|
header = reader.Header
|
||||||
defer reader.Close()
|
defer reader.Close()
|
||||||
} else {
|
} else {
|
||||||
c.email.Seek(0, os.SEEK_SET)
|
c.email.Seek(0, io.SeekStart)
|
||||||
}
|
}
|
||||||
// Update headers
|
// Update headers
|
||||||
mhdr := (*message.Header)(&header.Header)
|
mhdr := (*message.Header)(&header.Header)
|
||||||
|
@ -336,7 +336,7 @@ func (c *Composer) WriteMessage(header *mail.Header, writer io.Writer) error {
|
||||||
body = part.Body
|
body = part.Body
|
||||||
defer reader.Close()
|
defer reader.Close()
|
||||||
} else {
|
} else {
|
||||||
c.email.Seek(0, os.SEEK_SET)
|
c.email.Seek(0, io.SeekStart)
|
||||||
body = c.email
|
body = c.email
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue