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 --- lib/crypto/gpg/gpg.go | 1 - lib/crypto/gpg/gpgbin/encrypt.go | 2 +- lib/crypto/pgp/pgp.go | 6 +++--- 3 files changed, 4 insertions(+), 5 deletions(-) (limited to 'lib/crypto') diff --git a/lib/crypto/gpg/gpg.go b/lib/crypto/gpg/gpg.go index e545e1c9..c73272a3 100644 --- a/lib/crypto/gpg/gpg.go +++ b/lib/crypto/gpg/gpg.go @@ -37,7 +37,6 @@ func (m *Mail) ImportKeys(r io.Reader) error { } func (m *Mail) Encrypt(buf *bytes.Buffer, rcpts []string, signer string, decryptKeys openpgp.PromptFunction, header *mail.Header) (io.WriteCloser, error) { - return Encrypt(buf, header.Header.Header, rcpts, signer) } diff --git a/lib/crypto/gpg/gpgbin/encrypt.go b/lib/crypto/gpg/gpgbin/encrypt.go index e72ba148..31245a74 100644 --- a/lib/crypto/gpg/gpgbin/encrypt.go +++ b/lib/crypto/gpg/gpgbin/encrypt.go @@ -11,7 +11,7 @@ import ( // Encrypt runs gpg --encrypt [--sign] -r [recipient]. The default is to have // --trust-model always set func Encrypt(r io.Reader, to []string, from string) ([]byte, error) { - //TODO probably shouldn't have --trust-model always a default + // TODO probably shouldn't have --trust-model always a default args := []string{ "--armor", "--trust-model", "always", diff --git a/lib/crypto/pgp/pgp.go b/lib/crypto/pgp/pgp.go index 647b091b..c305f068 100644 --- a/lib/crypto/pgp/pgp.go +++ b/lib/crypto/pgp/pgp.go @@ -31,10 +31,10 @@ var ( func (m *Mail) Init() error { logging.Infof("Initializing PGP keyring") - os.MkdirAll(path.Join(xdg.DataHome(), "aerc"), 0700) + os.MkdirAll(path.Join(xdg.DataHome(), "aerc"), 0o700) lockpath := path.Join(xdg.DataHome(), "aerc", "keyring.lock") - lockfile, err := os.OpenFile(lockpath, os.O_CREATE|os.O_EXCL, 0600) + lockfile, err := os.OpenFile(lockpath, os.O_CREATE|os.O_EXCL, 0o600) if err != nil { // TODO: Consider connecting to main process over IPC socket locked = false @@ -149,7 +149,7 @@ func (m *Mail) ImportKeys(r io.Reader) error { Keyring = append(Keyring, keys...) if locked { keypath := path.Join(xdg.DataHome(), "aerc", "keyring.asc") - keyfile, err := os.OpenFile(keypath, os.O_CREATE|os.O_APPEND, 0600) + keyfile, err := os.OpenFile(keypath, os.O_CREATE|os.O_APPEND, 0o600) if err != nil { return err } -- cgit