aboutsummaryrefslogtreecommitdiffstats
path: root/commands/msgview/save.go
diff options
context:
space:
mode:
authorMoritz Poldrack <git@moritz.sh>2022-07-31 22:16:40 +0200
committerRobin Jarry <robin@jarry.cc>2022-08-01 10:44:52 +0200
commitaaf0a0c65673db4b94c0dc200d7394a192128da1 (patch)
tree44940936efff55b49a6d359d053f55c7ab824e4d /commands/msgview/save.go
parent21dcd440f877192af128c00ca2acbabf68bb3ee3 (diff)
downloadaerc-aaf0a0c65673db4b94c0dc200d7394a192128da1.tar.gz
lint: apply new formatting rules
Run `make fmt`. Signed-off-by: Moritz Poldrack <git@moritz.sh> Acked-by: Robin Jarry <robin@jarry.cc>
Diffstat (limited to 'commands/msgview/save.go')
-rw-r--r--commands/msgview/save.go9
1 files changed, 4 insertions, 5 deletions
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