Просмотр исходного кода

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 <bradfitz@golang.org>
helloPiers 8 лет назад
Родитель
Сommit
dbc2be9168
1 измененных файлов с 4 добавлено и 2 удалено
  1. 4 2
      windows/svc/mgr/mgr.go

+ 4 - 2
windows/svc/mgr/mgr.go

@@ -76,8 +76,10 @@ func toStringBlock(ss []string) *uint16 {
 // CreateService installs new service name on the system.
 // CreateService installs new service name on the system.
 // The service will be executed by running exepath binary.
 // The service will be executed by running exepath binary.
 // Use config c to specify service parameters.
 // 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) {
 func (m *Mgr) CreateService(name, exepath string, c Config, args ...string) (*Service, error) {
 	if c.StartType == 0 {
 	if c.StartType == 0 {
 		c.StartType = StartManual
 		c.StartType = StartManual