Migrate to Go 1.18 (#45)

* Migrate to Go 1.18 and add linters
This commit is contained in:
Jonas Plum
2022-03-20 03:17:18 +01:00
committed by GitHub
parent 03a4806d45
commit 2bad1f5f28
88 changed files with 1430 additions and 868 deletions
+2 -1
View File
@@ -50,7 +50,7 @@ func New(c *Config) (*Bus, error) {
return &Bus{config: c, client: client}, err
}
func (b *Bus) jsonPublish(msg interface{}, channel, key string) error {
func (b *Bus) jsonPublish(msg any, channel, key string) error {
payload, err := json.Marshal(msg)
if err != nil {
return err
@@ -65,5 +65,6 @@ func (b *Bus) safeSubscribe(key, channel string, handler func(c *emitter.Client,
log.Printf("Recovered %s in channel %s\n", r, channel)
}
}()
return b.client.Subscribe(key, channel, handler)
}