go fmt.
This commit is contained in:
+5
-5
@@ -1,11 +1,11 @@
|
|||||||
package service
|
package service
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"os"
|
|
||||||
"fmt"
|
"fmt"
|
||||||
"log/syslog"
|
"log/syslog"
|
||||||
"text/template"
|
"os"
|
||||||
"os/signal"
|
"os/signal"
|
||||||
|
"text/template"
|
||||||
)
|
)
|
||||||
|
|
||||||
func newService(name, displayName, description string) (s *linuxUpstartService, err error) {
|
func newService(name, displayName, description string) (s *linuxUpstartService, err error) {
|
||||||
@@ -50,14 +50,14 @@ func (s *linuxUpstartService) Install() error {
|
|||||||
Display string
|
Display string
|
||||||
Description string
|
Description string
|
||||||
Path string
|
Path string
|
||||||
} {
|
}{
|
||||||
s.displayName,
|
s.displayName,
|
||||||
s.description,
|
s.description,
|
||||||
path,
|
path,
|
||||||
}
|
}
|
||||||
|
|
||||||
t := template.Must(template.New("upstartScript").Parse(upstartScript))
|
t := template.Must(template.New("upstartScript").Parse(upstartScript))
|
||||||
err = t.Execute(f,to)
|
err = t.Execute(f, to)
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
@@ -82,7 +82,7 @@ func (s *linuxUpstartService) Run(onStart, onStop func() error) error {
|
|||||||
|
|
||||||
signal.Notify(sigChan, os.Kill)
|
signal.Notify(sigChan, os.Kill)
|
||||||
|
|
||||||
<- sigChan
|
<-sigChan
|
||||||
|
|
||||||
return onStop()
|
return onStop()
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user