all: fix minor issues found by staticcheck
Signed-off-by: Moritz Poldrack <git@moritz.sh>
This commit is contained in:
parent
65ae87a524
commit
4bc43d2741
11 changed files with 17 additions and 27 deletions
|
@ -37,7 +37,7 @@ func (Open) Execute(aerc *widgets.Aerc, args []string) error {
|
|||
if part, err := p.Msg.BodyStructure.PartAtIndex(p.Index); err == nil {
|
||||
mimeType := fmt.Sprintf("%s/%s", part.MIMEType, part.MIMESubType)
|
||||
|
||||
if exts, _ := mime.ExtensionsByType(mimeType); exts != nil && len(exts) > 0 {
|
||||
if exts, _ := mime.ExtensionsByType(mimeType); len(exts) > 0 {
|
||||
extension = exts[0]
|
||||
}
|
||||
}
|
||||
|
|
|
@ -151,10 +151,8 @@ func isDirExists(path string) bool {
|
|||
//pathExists returns true if path exists
|
||||
func pathExists(path string) bool {
|
||||
_, err := os.Stat(path)
|
||||
if err != nil {
|
||||
return false // we don't really care why it failed
|
||||
}
|
||||
return true
|
||||
|
||||
return err == nil
|
||||
}
|
||||
|
||||
//isAbsPath returns true if path given is anchored to / or . or ~
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue