1
0
mirror of https://github.com/golang/go synced 2024-09-29 12:14:28 -06:00

update test

This commit is contained in:
Mateusz Poliwczak 2022-11-17 09:44:54 +01:00
parent eb872127d6
commit 894f066bbc
2 changed files with 3 additions and 7 deletions

View File

@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
//go:build darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris || aix
//go:build unix
package net

View File

@ -10,7 +10,6 @@ import (
"context"
"errors"
"fmt"
"io/fs"
"os"
"path"
"path/filepath"
@ -2531,7 +2530,7 @@ func TestLookupOrderFilesNoSuchHost(t *testing.T) {
if runtime.GOOS == "openbsd" {
// Set error to ErrNotExist, so that the hostLookupOrder
// returns hostLookupFiles for openbsd.
resolvConf.err = fs.ErrNotExist
resolvConf.err = os.ErrNotExist
}
if !conf.forceUpdateConf(&resolvConf, time.Now().Add(time.Hour)) {
@ -2539,12 +2538,9 @@ func TestLookupOrderFilesNoSuchHost(t *testing.T) {
}
tmpFile := filepath.Join(t.TempDir(), "hosts")
f, err := os.OpenFile(tmpFile, os.O_CREATE|os.O_WRONLY, 0660)
if err != nil {
if err := os.WriteFile(tmpFile, []byte{}, 0660); err != nil {
t.Fatal(err)
}
defer f.Close()
testHookHostsPath = tmpFile
const testName = "test.invalid"