From d6cf4ab8872441dde3caef9d30cf52d36bdca31a Mon Sep 17 00:00:00 2001 From: Alex Brainman Date: Sat, 6 Mar 2021 07:53:19 +1100 Subject: [PATCH] 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 Run-TryBot: Alex Brainman Reviewed-by: Brad Fitzpatrick --- windows/svc/svc_test.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/windows/svc/svc_test.go b/windows/svc/svc_test.go index a6c8bbc9..e8684dd2 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 @@ 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.