We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
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
Please answer these questions before submitting your issue. Thanks!
go version
go env
GOARCH="amd64" GOBIN="" GOCACHE="/Users/username/Library/Caches/go-build" GOEXE="" GOHOSTARCH="amd64" GOHOSTOS="darwin" GOOS="darwin" GOPATH="/Users/username/go" GORACE="" GOROOT="/usr/local/Cellar/go/1.10/libexec" GOTMPDIR="" GOTOOLDIR="/usr/local/Cellar/go/1.10/libexec/pkg/tool/darwin_amd64" GCCGO="gccgo" CC="clang" CXX="clang++" CGO_ENABLED="1" 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/9k/pvfwqqzn6fqbpwghhrcjkm480000gn/T/go-build409818854=/tmp/go-build -gno-record-gcc-switches -fno-common"
I try to appry method expression function from this code example
package main import ( "fmt" "io" "log" "os" ) func main() { var b []byte = make([]byte, 100) v := struct{ io.Reader }{os.Stdin} f := struct{ io.Reader }.Read n, err := f(v, b) if err != nil { log.Fatal(err) } fmt.Println(n) }
> go run temp.go 0x1090c50 Hello 6
# command-line-arguments go.struct { io.Reader }.Read·f: relocation target go.struct { io.Reader }.Read not defined go.struct { io.Reader }.Read·f: undefined: "go.struct { io.Reader }.Read"
But when I add fmt.Println(f) like this
fmt.Println(f)
package main import ( "fmt" "io" "log" "os" ) func main() { var b []byte = make([]byte, 100) v := struct{ io.Reader }{os.Stdin} f := struct{ io.Reader }.Read fmt.Println(f) n, err := f(v, b) if err != nil { log.Fatal(err) } fmt.Println(n) }
I can run with expected result.
The text was updated successfully, but these errors were encountered:
This looks like a duplicate of #22444 to me.
Sorry, something went wrong.
No branches or pull requests
Please answer these questions before submitting your issue. Thanks!
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
What operating system and processor architecture are you using (
go env
)?GOARCH="amd64"
GOBIN=""
GOCACHE="/Users/username/Library/Caches/go-build"
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOOS="darwin"
GOPATH="/Users/username/go"
GORACE=""
GOROOT="/usr/local/Cellar/go/1.10/libexec"
GOTMPDIR=""
GOTOOLDIR="/usr/local/Cellar/go/1.10/libexec/pkg/tool/darwin_amd64"
GCCGO="gccgo"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
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/9k/pvfwqqzn6fqbpwghhrcjkm480000gn/T/go-build409818854=/tmp/go-build -gno-record-gcc-switches -fno-common"
What did you do?
I try to appry method expression function from this code example
What did you expect to see?
What did you see instead?
But when I add
fmt.Println(f)
like thisI can run with expected result.
The text was updated successfully, but these errors were encountered: