From dbc2be9168a660ef302e04b6ff6406de6f967473 Mon Sep 17 00:00:00 2001 From: helloPiers Date: Sat, 20 May 2017 18:05:02 +0100 Subject: [PATCH] windows/svc/mgr: correct documentation for args parameter of Mgr.CreateService The args passed to Mgr.CreateService end up as the command-line arguments (available via os.Args), not as the args passed to Svc.Handler.Execute. Fixes golang/go#20440 Change-Id: I55a1ec3432b377082c018fe960114c96350e8978 Reviewed-on: https://go-review.googlesource.com/43714 Reviewed-by: Brad Fitzpatrick --- windows/svc/mgr/mgr.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/windows/svc/mgr/mgr.go b/windows/svc/mgr/mgr.go index da8ceb6e..e20a1faa 100644 --- a/windows/svc/mgr/mgr.go +++ b/windows/svc/mgr/mgr.go @@ -76,8 +76,10 @@ func toStringBlock(ss []string) *uint16 { // CreateService installs new service name on the system. // The service will be executed by running exepath binary. // Use config c to specify service parameters. -// If service StartType is set to StartAutomatic, -// args will be passed to svc.Handle.Execute. +// Any args will be passed as command-line arguments when +// the service is started; these arguments are distinct from +// the arguments passed to Service.Start or via the "Start +// parameters" field in the service's Properties dialog box. func (m *Mgr) CreateService(name, exepath string, c Config, args ...string) (*Service, error) { if c.StartType == 0 { c.StartType = StartManual