Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"func (*Resolver) LookupIP" seems not exists, but it is in the documentation #41469

Closed
tech-ozon-io opened this issue Sep 18, 2020 · 3 comments
Closed
Labels

Comments

@tech-ozon-io
Copy link

@tech-ozon-io tech-ozon-io commented Sep 18, 2020

What version of Go are you using (go version)?

$ go version
go version go1.14.6 darwin/amd64

Does this issue reproduce with the latest release?

package main
import "context"
import "net"
func GoogleDNSDialer(ctx context.Context, network, address string) (net.Conn, error) {
   d := net.Dialer{}
   return d.DialContext(ctx, "udp", "8.8.8.8:53")
}
var local_resolver net.Resolver = net.Resolver{
   Dial: GoogleDNSDialer,
}
func LocalLookupIP(name string) ([]net.IP, error) {
   return local_resolver.LookupIP(context.Background(), "ip", name)
}
go build

What operating system and processor architecture are you using (go env)?

go env Output
$ go env

GO111MODULE=""
GOARCH="amd64"
GOBIN=""
GOCACHE="/Users/thierryfournier/Library/Caches/go-build"
GOENV="/Users/thierryfournier/Library/Application Support/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOINSECURE=""
GONOPROXY=""
GONOSUMDB=""
GOOS="darwin"
GOPATH="/Users/thierryfournier/go"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/usr/local/go"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/local/go/pkg/tool/darwin_amd64"
GCCGO="gccgo"
AR="ar"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD=""
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/_d/zs7l5ldx1r94fn_qh1zvn1rw0000gn/T/go-build235743352=/tmp/go-build -gno-record-gcc-switches -fno-common"

What did you do?

Compilation error is:

./a.go:12:25: local_resolver.LookupIP undefined (type net.Resolver has no field or method LookupIP)

But the documentation says that the function "func (*Resolver) LookupIP" exists:
https://godoc.org/net#Resolver.LookupIP

I check the file "/usr/local/go/src/net/lookup.go" and the function doesn't exists

What did you expect to see?

My build works (or fix the documentation).

What did you see instead?

@bokunodev
Copy link

@bokunodev bokunodev commented Sep 18, 2020

have you tried to clear all cache ? (go clean -cache -modcache)
then rebuild ?

@seankhliao
Copy link
Contributor

@seankhliao seankhliao commented Sep 18, 2020

this was added in 1.15 (see version at the right) https://golang.org/pkg/net/#Resolver.LookupIP

@davecheney
Copy link
Contributor

@davecheney davecheney commented Sep 18, 2020

Thank you for raising this issue. As this questions has been answered, I am going to close this issue.

Unlike many projects, the Go project does not use GitHub Issues for general discussion or asking questions. GitHub Issues are used for tracking bugs and proposals only.

For asking questions, see:

@davecheney davecheney closed this Sep 18, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
5 participants
You can’t perform that action at this time.