aboutsummaryrefslogtreecommitdiffstats
path: root/commands/msgview
diff options
context:
space:
mode:
Diffstat (limited to 'commands/msgview')
-rw-r--r--commands/msgview/msgview.go4
-rw-r--r--commands/msgview/save.go9
2 files changed, 5 insertions, 8 deletions
diff --git a/commands/msgview/msgview.go b/commands/msgview/msgview.go
index 0f0108e2..fb32d8e1 100644
--- a/commands/msgview/msgview.go
+++ b/commands/msgview/msgview.go
@@ -4,9 +4,7 @@ import (
"git.sr.ht/~rjarry/aerc/commands"
)
-var (
- MessageViewCommands *commands.Commands
-)
+var MessageViewCommands *commands.Commands
func register(cmd commands.Command) {
if MessageViewCommands == nil {
diff --git a/commands/msgview/save.go b/commands/msgview/save.go
index f27a68c6..993f4278 100644
--- a/commands/msgview/save.go
+++ b/commands/msgview/save.go
@@ -129,7 +129,6 @@ func savePart(
aerc *widgets.Aerc,
params *saveParams,
) error {
-
if params.trailingSlash || isDirExists(path) {
filename := generateFilename(pi.Part)
path = filepath.Join(path, filename)
@@ -137,7 +136,7 @@ func savePart(
dir := filepath.Dir(path)
if params.createDirs && dir != "" {
- err := os.MkdirAll(dir, 0755)
+ err := os.MkdirAll(dir, 0o755)
if err != nil {
return err
}
@@ -177,7 +176,7 @@ func savePart(
return nil
}
-//isDir returns true if path is a directory and exists
+// isDir returns true if path is a directory and exists
func isDirExists(path string) bool {
pathinfo, err := os.Stat(path)
if err != nil {
@@ -189,14 +188,14 @@ func isDirExists(path string) bool {
return false
}
-//pathExists returns true if path exists
+// pathExists returns true if path exists
func pathExists(path string) bool {
_, err := os.Stat(path)
return err == nil
}
-//isAbsPath returns true if path given is anchored to / or . or ~
+// isAbsPath returns true if path given is anchored to / or . or ~
func isAbsPath(path string) bool {
if len(path) == 0 {
return false