hashicorp / hashicorp/serf

Inconsistent typing in RPC client

Open
#438 1 comment 0 reactions 0 assignees View on GitHub
question
Dominant language
Go
Stars
6.1k
Forks
609
Avg merge
15h 1m
Merged PRs (30d)
3

Description

Right now we should do something like this:
```go
for m := range ch {
if m["Event"] == "query" {
fmt.Println("Query payload: ", string(m["Payload"].([]byte)))
c.Respond(uint64(m["ID"].(int64)), []byte("response"))
}
}
```
due to inconsistent typing (``uint64`` and ``int64``).

And yeah, I don't understand why use maps here instead of structs as they are already defined in serf/serf. Godocs are silent about this, I was only able to obtain the map format via testing it myself.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.