Skip to content
This repository has been archived by the owner on Nov 9, 2024. It is now read-only.

Commit

Permalink
call defer afte rinit.
Browse files Browse the repository at this point in the history
  • Loading branch information
AnalogJ committed Nov 16, 2019
1 parent 9041f05 commit 4c098cd
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion cmd/fs-publisher/fs-publisher.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,15 @@ func main() {
var notifyClient notify.Interface

notifyClient = new(notify.AmqpNotify)
notifyClient.Init(map[string]string{
err := notifyClient.Init(map[string]string{
"amqp-url": c.String("amqp-url"),
"exchange": c.String("amqp-exchange"),
"queue": c.String("amqp-queue"),
})
if err != nil {
return err
}
defer notifyClient.Close()

watcher := watch.FsWatcher{}
watcher.Start(notifyClient, map[string]string{
Expand Down

0 comments on commit 4c098cd

Please sign in to comment.