Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
adam.huang
go-libp2p
Commits
39e17efa
Unverified
Commit
39e17efa
authored
Jun 13, 2018
by
Steven Allen
Committed by
GitHub
Jun 13, 2018
Browse files
Merge pull request #358 from libp2p/nit/better-reflect-error
improve error message in libp2p reflection-based transport option
parents
b0176809
555afdb8
Changes
1
Hide whitespace changes
Inline
Side-by-side
config/reflection_magic.go
View file @
39e17efa
...
...
@@ -23,7 +23,7 @@ func checkReturnType(fnType, tptType reflect.Type) error {
fallthrough
case
1
:
if
!
fnType
.
Out
(
0
)
.
Implements
(
tptType
)
{
return
fmt
.
Errorf
(
"
expected first return value from transport constructor to be a transport"
)
return
fmt
.
Errorf
(
"
transport constructor returns %s which doesn't implement %s"
,
fnType
.
Out
(
0
),
tptType
)
}
default
:
return
fmt
.
Errorf
(
"expected transport constructor to return a transport and, optionally, an error"
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment