diff --git a/contrib/jepsen/main.go b/contrib/jepsen/main.go index 308c2f45e5a..9b60cefcc65 100644 --- a/contrib/jepsen/main.go +++ b/contrib/jepsen/main.go @@ -241,9 +241,8 @@ func runJepsenTest(test *JepsenTest) int { // Check jepsen source to be sure. if strings.Contains(out.String(), "Analysis invalid") { return TestFail - } else { - return TestIncomplete } + return TestIncomplete } if strings.Contains(out.String(), "Everything looks good!") { return TestPass diff --git a/dgraph/cmd/live/run.go b/dgraph/cmd/live/run.go index 6201eda0fc5..6fdab38b2fe 100644 --- a/dgraph/cmd/live/run.go +++ b/dgraph/cmd/live/run.go @@ -362,9 +362,8 @@ func run() error { totalFiles := len(filesList) if totalFiles == 0 { return fmt.Errorf("No data files found in %s", opt.dataFiles) - } else { - fmt.Printf("Found %d data file(s) to process\n", totalFiles) } + fmt.Printf("Found %d data file(s) to process\n", totalFiles) // x.Check(dgraphClient.NewSyncMarks(filesList)) errCh := make(chan error, totalFiles) diff --git a/posting/list_test.go b/posting/list_test.go index 0efc83ea1e4..4ef7f864e8d 100644 --- a/posting/list_test.go +++ b/posting/list_test.go @@ -1058,6 +1058,7 @@ func TestMultiPartListWriteToDisk(t *testing.T) { require.NoError(t, writePostingListToDisk(kvs)) newList, err := getNew(kvs[0].Key, ps) + require.NoError(t, err) opt := ListOptions{ReadTs: uint64(size) + 1} originalUids, err := originalList.Uids(opt) diff --git a/x/file.go b/x/file.go index 5f2e835bff6..25c71fadabc 100644 --- a/x/file.go +++ b/x/file.go @@ -91,7 +91,7 @@ func FindDataFiles(str string, ext []string) []string { x.Check(err) if fi.IsDir() { - match_fn := func(f string) bool { + matchFn := func(f string) bool { for _, e := range ext { if strings.HasSuffix(f, e) { return true @@ -99,7 +99,7 @@ func FindDataFiles(str string, ext []string) []string { } return false } - list = FindFilesFunc(str, match_fn) + list = FindFilesFunc(str, matchFn) } } diff --git a/z/client.go b/z/client.go index f4ab211bb4f..22ea8818069 100644 --- a/z/client.go +++ b/z/client.go @@ -53,12 +53,12 @@ func init() { var grpcPort int getPort := func(envVar string, dfault int) int { - if p := os.Getenv(envVar); p == "" { + p := os.Getenv(envVar) + if p == "" { return dfault - } else { - port, _ := strconv.Atoi(p) - return port } + port, _ := strconv.Atoi(p) + return port } grpcPort = getPort("TEST_PORT_ALPHA", 9180)