Skip to content

Commit

Permalink
Fixed warnings reported by golint
Browse files Browse the repository at this point in the history
Added some missing comments to exported symbols
Renamed tests/message_encoding to tests/encoding
As well as other minor cleanups
  • Loading branch information
johningve authored and meling committed Jul 20, 2020
1 parent 3a3c36c commit 141fef6
Show file tree
Hide file tree
Showing 8 changed files with 18 additions and 12 deletions.
2 changes: 2 additions & 0 deletions benchmark/benchmark.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ type Options struct {
Remote bool // Whether the servers are remote (true) or local (false)
}

// Bench is a Benchmark with a name and description
type Bench struct {
Name string
Description string
Expand Down Expand Up @@ -241,6 +242,7 @@ func runServerBenchmark(opts Options, cfg *Configuration, f serverFunc) (*Result
return resp, nil
}

// GetBenchmarks returns a list of Benchmarks that can be performed on the configuration
func GetBenchmarks(cfg *Configuration) []Bench {
m := []Bench{
{
Expand Down
2 changes: 1 addition & 1 deletion cmd/protoc-gen-gorums/dev/mgr.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ func NewManager(opts ...ManagerOption) (*Manager, error) {
if m.opts.idMapping != nil {
for naddr, id := range m.opts.idMapping {
if m.lookup[id] != nil {
err := fmt.Errorf("two node ids are identical(id %d). Node ids has to be unique!", id)
err := fmt.Errorf("Two node ids are identical(id %d). Node ids have to be unique", id)
return nil, ManagerCreationError(err)
}
nodeAddrs = append(nodeAddrs, naddr)
Expand Down
1 change: 1 addition & 0 deletions cmd/protoc-gen-gorums/dev/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ func WithServerBufferSize(size uint) ServerOption {
}
}

// WithGRPCServerOptions allows to set gRPC options for the server.
func WithGRPCServerOptions(opts ...grpc.ServerOption) ServerOption {
return func(o *serverOptions) {
o.grpcOpts = append(o.grpcOpts, opts...)
Expand Down
3 changes: 2 additions & 1 deletion cmd/protoc-gen-gorums/gengorums/template_static.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 6 additions & 4 deletions examples/storage/repl.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,8 @@ func (r repl) ReadLine() (string, error) {
return r.term.ReadLine()
}

// Repl runs an interactive Read-eval-print loop, that allows users to run commands that perform
// RPCs and quorum calls using the manager and configuration.
func Repl(mgr *proto.Manager, defaultCfg *proto.Configuration) {
r := newRepl(mgr, defaultCfg)

Expand Down Expand Up @@ -193,7 +195,7 @@ func (r repl) qcCfg(args []string) {
}
}

func (_ repl) readRPC(args []string, node *proto.Node) {
func (repl) readRPC(args []string, node *proto.Node) {
if len(args) < 1 {
fmt.Println("Read requires a key to read.")
return
Expand All @@ -212,7 +214,7 @@ func (_ repl) readRPC(args []string, node *proto.Node) {
fmt.Printf("%s = %s\n", args[0], resp.GetValue())
}

func (_ repl) writeRPC(args []string, node *proto.Node) {
func (repl) writeRPC(args []string, node *proto.Node) {
if len(args) < 2 {
fmt.Println("Write requires a key and a value to write.")
return
Expand All @@ -231,7 +233,7 @@ func (_ repl) writeRPC(args []string, node *proto.Node) {
fmt.Println("Write OK")
}

func (_ repl) readQC(args []string, cfg *proto.Configuration) {
func (repl) readQC(args []string, cfg *proto.Configuration) {
if len(args) < 1 {
fmt.Println("Read requires a key to read.")
return
Expand All @@ -250,7 +252,7 @@ func (_ repl) readQC(args []string, cfg *proto.Configuration) {
fmt.Printf("%s = %s\n", args[0], resp.GetValue())
}

func (_ repl) writeQC(args []string, cfg *proto.Configuration) {
func (repl) writeQC(args []string, cfg *proto.Configuration) {
if len(args) < 2 {
fmt.Println("Write requires a key and a value to write.")
return
Expand Down
6 changes: 3 additions & 3 deletions tests/Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Tests that should be run each time
RUNTESTS := ordering message_encoding metadata tls reconnect
RUNTESTS := ordering encoding metadata tls reconnect

.PHONY: all runtests qf order message_encoding metadata tls reconnect
.PHONY: all runtests qf order encoding metadata tls reconnect

all: $(RUNTESTS)

Expand All @@ -14,7 +14,7 @@ qf: qf/qf.pb.go qf/qf_grpc.pb.go qf/qf_gorums.pb.go

ordering: ordering/order.pb.go ordering/order_gorums.pb.go

message_encoding: message_encoding/message_encoding.pb.go message_encoding/message_encoding_gorums.pb.go
encoding: encoding/encoding.pb.go encoding/encoding_gorums.pb.go

metadata: metadata/metadata.pb.go metadata/metadata_gorums.pb.go

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
syntax = "proto3";

package message_encoding;
package encoding;

option go_package = "github.com/relab/gorums/tests/message_encoding";
option go_package = "github.com/relab/gorums/tests/encoding";

import "gorums.proto";

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package message_encoding
package encoding

import (
"fmt"
Expand Down

0 comments on commit 141fef6

Please sign in to comment.