accounts/keystore: fix formatting nits

This commit is contained in:
Felix Lange 2017-12-19 14:54:16 +01:00
parent 794564046f
commit e798e8ff18
2 changed files with 3 additions and 14 deletions

View file

@ -36,23 +36,18 @@ type fileCache struct {
} }
func (fc *fileCache) checkFile(path string) (created, deleted, updated bool, err error) { func (fc *fileCache) checkFile(path string) (created, deleted, updated bool, err error) {
fc.mu.Lock() fc.mu.Lock()
defer fc.mu.Unlock() defer fc.mu.Unlock()
created, deleted, updated, err = false, false, false, nil created, deleted, updated, err = false, false, false, nil
previouslyKnown := fc.all.Has(path) previouslyKnown := fc.all.Has(path)
fi, err := os.Lstat(path) fi, err := os.Lstat(path)
if err != nil { if err != nil {
//A file has been deleted, but it can be a file which we // A file has been deleted, but it can be a file which we
// were not previously watching. // were not previously watching.
deleted = previouslyKnown && os.IsNotExist(err) deleted = previouslyKnown && os.IsNotExist(err)
return created, deleted, updated, err return created, deleted, updated, err
} }
if skipKeyFile(fi) { if skipKeyFile(fi) {
log.Trace("Ignoring file on account scan", "path", path) log.Trace("Ignoring file on account scan", "path", path)
return created, deleted, updated, err return created, deleted, updated, err
@ -60,7 +55,6 @@ func (fc *fileCache) checkFile(path string) (created, deleted, updated bool, err
created = !previouslyKnown created = !previouslyKnown
updated = previouslyKnown updated = previouslyKnown
return created, deleted, updated, nil return created, deleted, updated, nil
} }

View file

@ -20,14 +20,13 @@ import (
"io/ioutil" "io/ioutil"
"math/rand" "math/rand"
"os" "os"
"path/filepath"
"runtime" "runtime"
"sort" "sort"
"strings" "strings"
"testing" "testing"
"time" "time"
"path/filepath"
"github.com/ethereum/go-ethereum/accounts" "github.com/ethereum/go-ethereum/accounts"
"github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/event" "github.com/ethereum/go-ethereum/event"
@ -377,11 +376,7 @@ func checkEvents(t *testing.T, want []walletEvent, have []walletEvent) {
} }
func tmpKeyStore(t *testing.T, encrypted bool) (string, *KeyStore) { func tmpKeyStore(t *testing.T, encrypted bool) (string, *KeyStore) {
var ( d, err := ioutil.TempDir("", "eth-keystore-test")
d string
err error
)
d, err = ioutil.TempDir("", "eth-keystore-test")
if err != nil { if err != nil {
t.Fatal(err) t.Fatal(err)
} }