Go fmt
This commit is contained in:
parent
c1703c2b68
commit
22893429ed
2 changed files with 13 additions and 13 deletions
|
@ -74,19 +74,19 @@ func removePidFile(pidfile string) {
|
|||
}
|
||||
|
||||
func daemon(pidfile string) error {
|
||||
if err := createPidFile(pidfile); err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
defer removePidFile(pidfile)
|
||||
if err := createPidFile(pidfile); err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
defer removePidFile(pidfile)
|
||||
|
||||
c := make(chan os.Signal, 1)
|
||||
signal.Notify(c, os.Interrupt, os.Kill, os.Signal(syscall.SIGTERM))
|
||||
go func() {
|
||||
sig := <-c
|
||||
log.Printf("Received signal '%v', exiting\n", sig)
|
||||
removePidFile(pidfile)
|
||||
os.Exit(0)
|
||||
}()
|
||||
c := make(chan os.Signal, 1)
|
||||
signal.Notify(c, os.Interrupt, os.Kill, os.Signal(syscall.SIGTERM))
|
||||
go func() {
|
||||
sig := <-c
|
||||
log.Printf("Received signal '%v', exiting\n", sig)
|
||||
removePidFile(pidfile)
|
||||
os.Exit(0)
|
||||
}()
|
||||
|
||||
service, err := docker.NewServer()
|
||||
if err != nil {
|
||||
|
|
|
@ -293,7 +293,7 @@ func (alloc *PortAllocator) Acquire(port int) (int, error) {
|
|||
|
||||
func newPortAllocator() (*PortAllocator, error) {
|
||||
allocator := &PortAllocator{
|
||||
inUse: make(map[int]struct{}),
|
||||
inUse: make(map[int]struct{}),
|
||||
fountain: make(chan int),
|
||||
}
|
||||
go allocator.runFountain()
|
||||
|
|
Loading…
Reference in a new issue