func NewService(sysService system.Service) *Service { service := sysService.Service() enabled, _ := sysService.Enabled() running, _ := sysService.Running() return &Service{ Service: service, Enabled: enabled.(bool), Running: running.(bool), } }
func NewService(sysService system.Service, config util.Config) (*Service, error) { service := sysService.Service() enabled, _ := sysService.Enabled() running, _ := sysService.Running() return &Service{ Service: service, Enabled: enabled.(bool), Running: running.(bool), }, nil }
func NewService(sysService system.Service, config util.Config) (*Service, error) { service := sysService.Service() enabled, err := sysService.Enabled() if err != nil { return nil, err } running, err := sysService.Running() if err != nil { return nil, err } return &Service{ Service: service, Enabled: enabled, Running: running, }, nil }