Skip to content

Commit

Permalink
service: make System.String() consistent.
Browse files Browse the repository at this point in the history
  • Loading branch information
kardianos committed May 1, 2015
1 parent 4841cf3 commit b722966
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 20 deletions.
2 changes: 1 addition & 1 deletion service_darwin.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import (

const maxPathSize = 32 * 1024

const version = "Darwin Launchd"
const version = "darwin-launchd"

type darwinSystem struct{}

Expand Down
21 changes: 3 additions & 18 deletions service_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,25 +5,10 @@
package service

import (
"fmt"
"os"
"strings"
)

type linuxSystem struct {
interactive bool
selectedName string
selectedNew func(i Interface, c *Config) (Service, error)
}

func (ls linuxSystem) String() string {
return fmt.Sprintf("Linux %s", ls.selectedName)
}

func (ls linuxSystem) Interactive() bool {
return ls.interactive
}

type linuxSystemService struct {
name string
detect func() bool
Expand All @@ -46,7 +31,7 @@ func (sc linuxSystemService) New(i Interface, c *Config) (Service, error) {

func init() {
ChooseSystem(linuxSystemService{
name: "systemd",
name: "linux-systemd",
detect: isSystemd,
interactive: func() bool {
is, _ := isInteractive()
Expand All @@ -55,7 +40,7 @@ func init() {
new: newSystemdService,
},
linuxSystemService{
name: "Upstart",
name: "linux-upstart",
detect: isUpstart,
interactive: func() bool {
is, _ := isInteractive()
Expand All @@ -64,7 +49,7 @@ func init() {
new: newUpstartService,
},
linuxSystemService{
name: "System-V",
name: "unix-systemv",
detect: func() bool { return true },
interactive: func() bool {
is, _ := isInteractive()
Expand Down
2 changes: 1 addition & 1 deletion service_windows.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import (
"golang.org/x/sys/windows/svc/mgr"
)

const version = "Windows Service"
const version = "windows-service"

type windowsService struct {
i Interface
Expand Down

0 comments on commit b722966

Please sign in to comment.