Merge pull request #235 from shuLhan/dev-shulhan
Fix warnings from linter output
This commit is contained in:
commit
dca078f30b
10
service.go
10
service.go
@ -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()
|
||||
}
|
||||
|
@ -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()
|
||||
})
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user