We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
on 5853a25
ipfs name resolve
2015/01/08 10:39:38 http: panic serving 127.0.0.1:47416: Commands must return a pointer, io.Reader, or channel goroutine 2511 [running]: net/http.func·011() /usr/local/go/src/pkg/net/http/server.go:1100 +0xb7 runtime.panic(0x906b20, 0xc208b07ba0) /usr/local/go/src/pkg/runtime/panic.c:248 +0x18d github.com/jbenet/go-ipfs/commands.checkType(0x906b20, 0xc208b07b90, 0x0, 0x0, 0x0, 0x0) /usr/local/golang/src/github.com/jbenet/go-ipfs/commands/command.go:262 +0x13e github.com/jbenet/go-ipfs/commands.(_Command).Call(0xef40a0, 0x2b5a7240a418, 0xc2083930e0, 0x0, 0x0) /usr/local/golang/src/github.com/jbenet/go-ipfs/commands/command.go:117 +0x68e github.com/jbenet/go-ipfs/commands/http.Handler.ServeHTTP(0x1, 0xc20800ef40, 0x15, 0xc2080403c0, 0xc6a1a0, 0xc208060240, 0xc20800efa0, 0xef40a0, 0xaeeef0, 0x0, ...) /usr/local/golang/src/github.com/jbenet/go-ipfs/commands/http/handler.go:67 +0x377 github.com/jbenet/go-ipfs/commands/http.(_Handler).ServeHTTP(0xc208456910, 0x2aaaaac11ad0, 0xc2080630e0, 0xc20845c000) :2 +0xb5 net/http.(_ServeMux).ServeHTTP(0xc208333800, 0x2aaaaac11ad0, 0xc2080630e0, 0xc20845c000) /usr/local/go/src/pkg/net/http/server.go:1511 +0x1a3 net/http.serverHandler.ServeHTTP(0xc2080434f8, 0x2aaaaac11ad0, 0xc2080630e0, 0xc20845c000) /usr/local/go/src/pkg/net/http/server.go:1673 +0x19f net/http.(_conn).serve(0xc208d14b00) /usr/local/go/src/pkg/net/http/server.go:1174 +0xa7e created by net/http.(*Server).Serve /usr/local/go/src/pkg/net/http/server.go:1721 +0x313
The text was updated successfully, but these errors were encountered:
@mappum
It's definitely not go idiomatic, but it works. Yeah, it's solid and mergeable.
Famous last words. the compiler is there for a reason. This is reflect abuse, and is going to keep hurting. Let's do this instead:
type Result struct { Value interface{} Chan chan interface{} Reader io.Reader }
And, if you can get rid of interface{} too, that'd be great. make a specific interface, like this:
interface{}
type ReturnValue interface { WriteTo(w io.Writer) }
Yeah. That actually obviates the need for the Result above-- can implement specific types for each of those.
Result
Maybe commands can write to a response Writer directly. This makes sense, by the way, as all commands will have to be stream-friendly.
Writer
Sorry, something went wrong.
Sorry for breaking things @zignig, reverted back to 04b938b.
@mappum I restored the assert-types branch
assert-types
No branches or pull requests
on 5853a25
2015/01/08 10:39:38 http: panic serving 127.0.0.1:47416: Commands must return a pointer, io.Reader, or channel
goroutine 2511 [running]:
net/http.func·011()
/usr/local/go/src/pkg/net/http/server.go:1100 +0xb7
runtime.panic(0x906b20, 0xc208b07ba0)
/usr/local/go/src/pkg/runtime/panic.c:248 +0x18d
github.com/jbenet/go-ipfs/commands.checkType(0x906b20, 0xc208b07b90, 0x0, 0x0, 0x0, 0x0)
/usr/local/golang/src/github.com/jbenet/go-ipfs/commands/command.go:262 +0x13e
github.com/jbenet/go-ipfs/commands.(_Command).Call(0xef40a0, 0x2b5a7240a418, 0xc2083930e0, 0x0, 0x0)
/usr/local/golang/src/github.com/jbenet/go-ipfs/commands/command.go:117 +0x68e
github.com/jbenet/go-ipfs/commands/http.Handler.ServeHTTP(0x1, 0xc20800ef40, 0x15, 0xc2080403c0, 0xc6a1a0, 0xc208060240, 0xc20800efa0, 0xef40a0, 0xaeeef0, 0x0, ...)
/usr/local/golang/src/github.com/jbenet/go-ipfs/commands/http/handler.go:67 +0x377
github.com/jbenet/go-ipfs/commands/http.(_Handler).ServeHTTP(0xc208456910, 0x2aaaaac11ad0, 0xc2080630e0, 0xc20845c000)
:2 +0xb5
net/http.(_ServeMux).ServeHTTP(0xc208333800, 0x2aaaaac11ad0, 0xc2080630e0, 0xc20845c000)
/usr/local/go/src/pkg/net/http/server.go:1511 +0x1a3
net/http.serverHandler.ServeHTTP(0xc2080434f8, 0x2aaaaac11ad0, 0xc2080630e0, 0xc20845c000)
/usr/local/go/src/pkg/net/http/server.go:1673 +0x19f
net/http.(_conn).serve(0xc208d14b00)
/usr/local/go/src/pkg/net/http/server.go:1174 +0xa7e
created by net/http.(*Server).Serve
/usr/local/go/src/pkg/net/http/server.go:1721 +0x313
The text was updated successfully, but these errors were encountered: