mirror of
https://github.com/golang/go
synced 2024-11-23 12:00:14 -07:00
update test
This commit is contained in:
parent
eb872127d6
commit
894f066bbc
@ -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
|
||||
|
||||
|
@ -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"
|
||||
|
Loading…
Reference in New Issue
Block a user