Merge pull request #235 from shuLhan/dev-shulhan

Fix warnings from linter output
This commit is contained in:
Asim Aslam 2018-03-13 18:25:37 +00:00 committed by GitHub
commit dca078f30b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 14 deletions

View File

@ -67,7 +67,7 @@ func (s *service) Init(opts ...Option) {
s.once.Do(func() {
// Initialise the command flags, overriding new service
s.opts.Cmd.Init(
_ = s.opts.Cmd.Init(
cmd.Broker(&s.opts.Broker),
cmd.Registry(&s.opts.Registry),
cmd.Transport(&s.opts.Transport),
@ -153,7 +153,7 @@ func (s *service) Run() error {
go s.run(ex)
ch := make(chan os.Signal, 1)
signal.Notify(ch, syscall.SIGTERM, syscall.SIGINT, syscall.SIGKILL)
signal.Notify(ch, syscall.SIGTERM, syscall.SIGINT, syscall.SIGQUIT)
select {
// wait on kill signal
@ -165,9 +165,5 @@ func (s *service) Run() error {
// exit reg loop
close(ex)
if err := s.Stop(); err != nil {
return err
}
return nil
return s.Stop()
}

View File

@ -30,10 +30,16 @@ func TestService(t *testing.T) {
// we can't test service.Init as it parses the command line
// service.Init()
// register handler
// do that later
t.Run("Run", func(t *testing.T) {
t.Parallel()
// run service
service.Run()
})
t.Run("Debug.Health", func(t *testing.T) {
t.Parallel()
go func() {
// wait for start
wg.Wait()
@ -57,8 +63,5 @@ func TestService(t *testing.T) {
// shutdown the service
cancel()
}()
// run service
service.Run()
})
}