Skip to content

Commit

Permalink
Fix golint warnings (#3331)
Browse files Browse the repository at this point in the history
  • Loading branch information
martinmr authored Apr 30, 2019
1 parent 26e8f0f commit 5794bd6
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 10 deletions.
3 changes: 1 addition & 2 deletions contrib/jepsen/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 1 addition & 2 deletions dgraph/cmd/live/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
1 change: 1 addition & 0 deletions posting/list_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions x/file.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,15 +91,15 @@ 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
}
}
return false
}
list = FindFilesFunc(str, match_fn)
list = FindFilesFunc(str, matchFn)
}
}

Expand Down
8 changes: 4 additions & 4 deletions z/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 5794bd6

Please sign in to comment.