windows/svc: use ioutil.WriteFile instead of os.WriteFile

os.WriteFile is not available on Go 1.15. But we still need to
support Go 1.15.

Fixes broken Go 1.15 build

https://build.golang.org/log/07b89b007d0aca2e97bc01cdf4c6a1d90e6732f9

Change-Id: I18433985ec82477160058ef96c160345304ba1ad
Reviewed-on: https://go-review.googlesource.com/c/sys/+/299309
Trust: Alex Brainman <alex.brainman@gmail.com>
Run-TryBot: Alex Brainman <alex.brainman@gmail.com>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
This commit is contained in:
Alex Brainman
2021-03-06 07:53:19 +11:00
parent 7844c3c200
commit d6cf4ab887

View File

@@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
//go:build windows
// +build windows
package svc_test
@@ -203,7 +204,7 @@ func TestIsWindowsServiceWhenParentExits(t *testing.T) {
if isSvc {
msg = "IsWindowsService retuns true when not running in a service."
}
err = os.WriteFile(dumpPath, []byte(msg), 0644)
err = ioutil.WriteFile(dumpPath, []byte(msg), 0644)
if err != nil {
// We cannot report this error. But main test will notice
// that we did not create dump file.