summaryrefslogtreecommitdiff
path: root/commands/msgview
diff options
context:
space:
mode:
authorMoritz Poldrack <git@moritz.sh>2022-03-09 22:48:00 +0100
committerRobin Jarry <robin@jarry.cc>2022-03-12 21:00:23 +0100
commit4bc43d2741fa4904e51fc5da71d15b804c556c43 (patch)
tree1747e08585ef0c98a13d3477369b4f159071a762 /commands/msgview
parent65ae87a524ebbb573626afe951d6cd29bc8b24cd (diff)
downloadaerc-4bc43d2741fa4904e51fc5da71d15b804c556c43.zip
all: fix minor issues found by staticcheck
Signed-off-by: Moritz Poldrack <git@moritz.sh>
Diffstat (limited to 'commands/msgview')
-rw-r--r--commands/msgview/open.go2
-rw-r--r--commands/msgview/save.go6
2 files changed, 3 insertions, 5 deletions
diff --git a/commands/msgview/open.go b/commands/msgview/open.go
index bcfe2b4..5b19912 100644
--- a/commands/msgview/open.go
+++ b/commands/msgview/open.go
@@ -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]
}
}
diff --git a/commands/msgview/save.go b/commands/msgview/save.go
index 713c6d1..26a6bf2 100644
--- a/commands/msgview/save.go
+++ b/commands/msgview/save.go
@@ -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 ~