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 {
|
func daemon(pidfile string) error {
|
||||||
if err := createPidFile(pidfile); err != nil {
|
if err := createPidFile(pidfile); err != nil {
|
||||||
log.Fatal(err)
|
log.Fatal(err)
|
||||||
}
|
}
|
||||||
defer removePidFile(pidfile)
|
defer removePidFile(pidfile)
|
||||||
|
|
||||||
c := make(chan os.Signal, 1)
|
c := make(chan os.Signal, 1)
|
||||||
signal.Notify(c, os.Interrupt, os.Kill, os.Signal(syscall.SIGTERM))
|
signal.Notify(c, os.Interrupt, os.Kill, os.Signal(syscall.SIGTERM))
|
||||||
go func() {
|
go func() {
|
||||||
sig := <-c
|
sig := <-c
|
||||||
log.Printf("Received signal '%v', exiting\n", sig)
|
log.Printf("Received signal '%v', exiting\n", sig)
|
||||||
removePidFile(pidfile)
|
removePidFile(pidfile)
|
||||||
os.Exit(0)
|
os.Exit(0)
|
||||||
}()
|
}()
|
||||||
|
|
||||||
service, err := docker.NewServer()
|
service, err := docker.NewServer()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
|
@ -293,7 +293,7 @@ func (alloc *PortAllocator) Acquire(port int) (int, error) {
|
||||||
|
|
||||||
func newPortAllocator() (*PortAllocator, error) {
|
func newPortAllocator() (*PortAllocator, error) {
|
||||||
allocator := &PortAllocator{
|
allocator := &PortAllocator{
|
||||||
inUse: make(map[int]struct{}),
|
inUse: make(map[int]struct{}),
|
||||||
fountain: make(chan int),
|
fountain: make(chan int),
|
||||||
}
|
}
|
||||||
go allocator.runFountain()
|
go allocator.runFountain()
|
||||||
|
|
Loading…
Reference in a new issue