github.com/rsc/go@v0.0.0-20150416155037-e040fd465409/src/net/netgo_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 TestGoLookupIP(t *testing.T) {
    13  	host := "localhost"
    14  	_, err, ok := cgoLookupIP(host)
    15  	if ok {
    16  		t.Errorf("cgoLookupIP must be a placeholder")
    17  	}
    18  	if err != nil {
    19  		t.Errorf("cgoLookupIP failed: %v", err)
    20  	}
    21  	if _, err := goLookupIP(host); err != nil {
    22  		t.Errorf("goLookupIP failed: %v", err)
    23  	}
    24  }