Skip to content

Commit

Permalink
Add CONTRIBUTING.md
Browse files Browse the repository at this point in the history
* fix go vet warnings
  • Loading branch information
jcelliott committed Sep 2, 2015
1 parent ea0bd70 commit cd69737
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 5 deletions.
15 changes: 15 additions & 0 deletions CONTRIBUTING.md
@@ -0,0 +1,15 @@
Contributing to Turnpike
===

Pull requests and bug reports are appreciated.

Pull Requests
---

1. If you want to contribute a major feature or change, please open an issue to
discuss first.
2. Please run `go fmt` on your code
3. Check that `go tool vet ./` produces no warnings when run from the directory
where you made changes.
4. Write a test for any non-trivial changes.
5. Make sure all the tests pass.
2 changes: 1 addition & 1 deletion router_test.go
Expand Up @@ -34,7 +34,7 @@ func basicConnect(t *testing.T, client *basicPeer, server Peer) Router {
}

if len(client.incoming) != 1 {
t.Fatal("Expected 1 message in the handshake, received %d", len(client.incoming))
t.Fatalf("Expected 1 message in the handshake, received %d", len(client.incoming))
}

if msg := <-client.incoming; msg.MessageType() != WELCOME {
Expand Down
6 changes: 3 additions & 3 deletions serialize_test.go
Expand Up @@ -30,9 +30,9 @@ func TestJSONDeserialize(t *testing.T) {
s := new(JSONSerializer)
for _, tst := range tests {
if msg, err := s.Deserialize([]byte(tst.packet)); err != nil {
t.Error("Error parsing good packet: %s, %s", err, tst.packet)
t.Errorf("Error parsing good packet: %s, %s", err, tst.packet)
} else if msg.MessageType() != tst.exp.MessageType() {
t.Error("Incorrect message type: %d != %d", msg.MessageType(), tst.exp.MessageType())
t.Errorf("Incorrect message type: %d != %d", msg.MessageType(), tst.exp.MessageType())
} else if !reflect.DeepEqual(msg, tst.exp) {
t.Errorf("%+v != %+v", msg, tst.exp)
}
Expand Down Expand Up @@ -79,7 +79,7 @@ func TestBinaryData(t *testing.T) {
var b BinaryData
err = json.Unmarshal(arr, &b)
if err != nil {
t.Errorf("Error unmarshalling marshalled BinaryData:", err)
t.Errorf("Error unmarshalling marshalled BinaryData: %v", err)
} else if !bytes.Equal([]byte(b), from) {
t.Errorf("%s != %s", string(b), string(from))
}
Expand Down
2 changes: 1 addition & 1 deletion websocket.go
Expand Up @@ -27,7 +27,7 @@ func NewWebsocketPeer(serialization Serialization, url, origin string) (Peer, er
new(MessagePackSerializer), websocket.BinaryMessage,
)
default:
return nil, fmt.Errorf("Unsupported serialization: %s", serialization)
return nil, fmt.Errorf("Unsupported serialization: %v", serialization)
}
}

Expand Down

0 comments on commit cd69737

Please sign in to comment.