Skip to content

chore: apply go vet improvements #8620

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,16 @@ linters-settings:
linters:
disable-all: true
enable:
#- errcheck
#- ineffassign
#- gas
#- gofmt
#- golint
#- gosimple
#- govet
- errcheck
- ineffassign
- gas
- gofmt
- golint
- gosimple
- govet
- lll
#- varcheck
#- unused
- varcheck
- unused

issues:
# Excluding configuration per-path, per-linter, per-text and per-source
Expand Down
6 changes: 3 additions & 3 deletions compose/compose.go
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ func getZero(idx int, raft string) service {
svc.Command += fmt.Sprintf(" --vmodule=%s", opts.Vmodule)
}
if idx == 1 {
svc.Command += fmt.Sprintf(" --bindall")
svc.Command += " --bindall"
} else {
svc.Command += fmt.Sprintf(" --peer=%s:%d", name(basename, 1), basePort)
}
Expand Down Expand Up @@ -734,9 +734,9 @@ func main() {

doc := fmt.Sprintf("# Auto-generated with: %v\n#\n", os.Args)
if opts.UserOwnership {
doc += fmt.Sprint("# NOTE: Env var UID must be exported by the shell\n#\n")
doc += "# NOTE: Env var UID must be exported by the shell\n#\n"
}
doc += fmt.Sprintf("%s", yml)
doc += string(yml)
if opts.OutFile == "-" {
x.Check2(fmt.Printf("%s", doc))
} else {
Expand Down
2 changes: 1 addition & 1 deletion contrib/integration/mutates/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ func testInsert3Quads(ctx context.Context, c *dgo.Dgraph) {

func testQuery3Quads(ctx context.Context, c *dgo.Dgraph) {
txn := c.NewTxn()
q := fmt.Sprint(`{ me(func: uid(200, 300, 400)) { name }}`)
q := `{ me(func: uid(200, 300, 400)) { name }}`
resp, err := txn.Query(ctx, q)
if err != nil {
log.Fatalf("Error while running query: %v\n", err)
Expand Down
15 changes: 0 additions & 15 deletions contrib/teamcity/README.md

This file was deleted.

262 changes: 0 additions & 262 deletions contrib/teamcity/test_stats.go

This file was deleted.

5 changes: 0 additions & 5 deletions dgraph/cmd/zero/oracle.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,6 @@ import (
"github.com/dgraph-io/ristretto/z"
)

type syncMark struct {
index uint64
ts uint64
}

// Oracle stores and manages the transaction state and conflict detection.
type Oracle struct {
x.SafeMutex
Expand Down
2 changes: 1 addition & 1 deletion dgraph/cmd/zero/tablet.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ func (s *Server) MoveTablet(ctx context.Context, req *pb.MoveTabletRequest) (*pb
}
if !isKnown {
return &pb.Status{Code: 1, Msg: x.ErrorInvalidRequest},
fmt.Errorf("Group: [%d] is not a known group.", req.DstGroup)
fmt.Errorf("group: [%d] is not a known group", req.DstGroup)
}

tablet := x.NamespaceAttr(req.Namespace, req.Tablet)
Expand Down
4 changes: 2 additions & 2 deletions dgraph/cmd/zero/zero_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ func TestIdBump(t *testing.T) {
bumpTo := res.GetEndId() + 100000

// Bump the lease to (last result + 100000).
res, err = zc.AssignIds(ctx, &pb.Num{Val: bumpTo, Type: pb.Num_UID, Bump: true})
_, err = zc.AssignIds(ctx, &pb.Num{Val: bumpTo, Type: pb.Num_UID, Bump: true})
require.NoError(t, err)

// Next assignemnt's startId should be greater than bumpTo.
Expand All @@ -81,6 +81,6 @@ func TestIdBump(t *testing.T) {
require.Equal(t, uint64(10), res.GetEndId()-res.GetStartId()+1)

// If bump request is less than maxLease, then it should result in no-op.
res, err = zc.AssignIds(ctx, &pb.Num{Val: 10, Type: pb.Num_UID, Bump: true})
_, err = zc.AssignIds(ctx, &pb.Num{Val: 10, Type: pb.Num_UID, Bump: true})
require.Contains(t, err.Error(), "Nothing to be leased")
}
Loading