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>
diff --git a/windows/svc/svc_test.go b/windows/svc/svc_test.go
index a6c8bbc..e8684dd 100644
--- a/windows/svc/svc_test.go
+++ b/windows/svc/svc_test.go
@@ -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 @@
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.