mirror of
https://github.com/rynbrd/go-service.git
synced 2026-04-22 23:27:13 +08:00
Print errors in example.
This commit is contained in:
+5
-1
@@ -35,7 +35,11 @@ loop:
|
|||||||
for {
|
for {
|
||||||
select {
|
select {
|
||||||
case event := <-events:
|
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:
|
case response := <-responses:
|
||||||
if response.Success() {
|
if response.Success() {
|
||||||
fmt.Printf("command %s succeeded\n", response.Name)
|
fmt.Printf("command %s succeeded\n", response.Name)
|
||||||
|
|||||||
Reference in New Issue
Block a user