diff options
author | Eli <elihanover@yahoo.com> | 2018-05-02 16:20:19 +0800 |
---|---|---|
committer | Péter Szilágyi <peterke@gmail.com> | 2018-05-02 16:20:19 +0800 |
commit | d76c5ca532bfeba5469ed42985630116a1f41ebe (patch) | |
tree | 6c63efd2c949fc30f90024a575a94f6ad11c0cf3 /tests/init_test.go | |
parent | c1ea52757358d2e9d87c636a9519ffdc74ea8ac0 (diff) | |
download | dexon-d76c5ca532bfeba5469ed42985630116a1f41ebe.tar.gz dexon-d76c5ca532bfeba5469ed42985630116a1f41ebe.tar.zst dexon-d76c5ca532bfeba5469ed42985630116a1f41ebe.zip |
tests: golint fixes for tests directory (#16640)
Diffstat (limited to 'tests/init_test.go')
-rw-r--r-- | tests/init_test.go | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/tests/init_test.go b/tests/init_test.go index fbb214b08..26e919d24 100644 --- a/tests/init_test.go +++ b/tests/init_test.go @@ -42,7 +42,7 @@ var ( difficultyTestDir = filepath.Join(baseDir, "BasicTests") ) -func readJson(reader io.Reader, value interface{}) error { +func readJSON(reader io.Reader, value interface{}) error { data, err := ioutil.ReadAll(reader) if err != nil { return fmt.Errorf("error reading JSON file: %v", err) @@ -57,14 +57,14 @@ func readJson(reader io.Reader, value interface{}) error { return nil } -func readJsonFile(fn string, value interface{}) error { +func readJSONFile(fn string, value interface{}) error { file, err := os.Open(fn) if err != nil { return err } defer file.Close() - err = readJson(file, value) + err = readJSON(file, value) if err != nil { return fmt.Errorf("%s in file %s", err.Error(), fn) } @@ -169,9 +169,8 @@ func (tm *testMatcher) checkFailure(t *testing.T, name string, err error) error if err != nil { t.Logf("error: %v", err) return nil - } else { - return fmt.Errorf("test succeeded unexpectedly") } + return fmt.Errorf("test succeeded unexpectedly") } return err } @@ -213,7 +212,7 @@ func (tm *testMatcher) runTestFile(t *testing.T, path, name string, runTest inte // Load the file as map[string]<testType>. m := makeMapFromTestFunc(runTest) - if err := readJsonFile(path, m.Addr().Interface()); err != nil { + if err := readJSONFile(path, m.Addr().Interface()); err != nil { t.Fatal(err) } |