github.com/peggyl/go@v0.0.0-20151008231540-ae315999c2d5/src/net/cgo_unix_test.go (about) 1 // Copyright 2013 The Go Authors. All rights reserved. 2 // Use of this source code is governed by a BSD-style 3 // license that can be found in the LICENSE file. 4 5 // +build cgo,!netgo 6 // +build darwin dragonfly freebsd linux netbsd openbsd solaris 7 8 package net 9 10 import "testing" 11 12 func TestCgoLookupIP(t *testing.T) { 13 host := "localhost" 14 _, err, ok := cgoLookupIP(host) 15 if !ok { 16 t.Errorf("cgoLookupIP must not be a placeholder") 17 } 18 if err != nil { 19 t.Error(err) 20 } 21 if _, err := goLookupIP(host); err != nil { 22 t.Error(err) 23 } 24 }