From aaf0a0c65673db4b94c0dc200d7394a192128da1 Mon Sep 17 00:00:00 2001 From: Moritz Poldrack Date: Sun, 31 Jul 2022 22:16:40 +0200 Subject: lint: apply new formatting rules Run `make fmt`. Signed-off-by: Moritz Poldrack Acked-by: Robin Jarry --- commands/msgview/msgview.go | 4 +--- commands/msgview/save.go | 9 ++++----- 2 files changed, 5 insertions(+), 8 deletions(-) (limited to 'commands/msgview') 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 -- cgit