mirror of
https://github.com/golang/go
synced 2024-10-05 09:21:22 -06:00
f77e10fb2e
This change simplifies unnecessarily redundant error messages in tests. There's no need to worry any more because package APIs now return consistent, self-descriptive error values. Alos renames ambiguous test functions and makes use of test tables. Change-Id: I7b61027607c4ae2a3cf605d08d58cf449fa27eb2 Reviewed-on: https://go-review.googlesource.com/9662 Reviewed-by: Ian Lance Taylor <iant@golang.org> Run-TryBot: Mikio Hara <mikioh.mikioh@gmail.com>
25 lines
527 B
Go
25 lines
527 B
Go
// Copyright 2013 The Go Authors. All rights reserved.
|
|
// Use of this source code is governed by a BSD-style
|
|
// license that can be found in the LICENSE file.
|
|
|
|
// +build !cgo netgo
|
|
// +build darwin dragonfly freebsd linux netbsd openbsd solaris
|
|
|
|
package net
|
|
|
|
import "testing"
|
|
|
|
func TestGoLookupIP(t *testing.T) {
|
|
host := "localhost"
|
|
_, err, ok := cgoLookupIP(host)
|
|
if ok {
|
|
t.Errorf("cgoLookupIP must be a placeholder")
|
|
}
|
|
if err != nil {
|
|
t.Error(err)
|
|
}
|
|
if _, err := goLookupIP(host); err != nil {
|
|
t.Error(err)
|
|
}
|
|
}
|