mirror of
https://github.com/rynbrd/go-service.git
synced 2025-12-24 12:37:52 +08:00
Print errors in example.
This commit is contained in:
@@ -35,7 +35,11 @@ loop:
|
||||
for {
|
||||
select {
|
||||
case event := <-events:
|
||||
fmt.Printf("service is %s\n", event.State)
|
||||
if event.Error == nil {
|
||||
fmt.Printf("service is %s\n", event.State)
|
||||
} else {
|
||||
fmt.Printf("service is %s: %s\n", event.State, event.Error)
|
||||
}
|
||||
case response := <-responses:
|
||||
if response.Success() {
|
||||
fmt.Printf("command %s succeeded\n", response.Name)
|
||||
|
||||
Reference in New Issue
Block a user