Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
p2p
go-eventbus
Commits
12782426
Commit
12782426
authored
Jun 27, 2019
by
Steven Allen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
nit: avoid ValueOf
We only need TypeOf.
parent
9c3fe058
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
basic.go
basic.go
+3
-3
No files found.
basic.go
View file @
12782426
...
@@ -230,9 +230,9 @@ func newNode(typ reflect.Type) *node {
...
@@ -230,9 +230,9 @@ func newNode(typ reflect.Type) *node {
}
}
func
(
n
*
node
)
emit
(
event
interface
{})
{
func
(
n
*
node
)
emit
(
event
interface
{})
{
eval
:=
reflect
.
Valu
eOf
(
event
)
typ
:=
reflect
.
Typ
eOf
(
event
)
if
eval
.
Type
()
!=
n
.
typ
{
if
typ
!=
n
.
typ
{
panic
(
fmt
.
Sprintf
(
"Emit called with wrong type. expected: %s, got: %s"
,
n
.
typ
,
eval
.
Type
()
))
panic
(
fmt
.
Sprintf
(
"Emit called with wrong type. expected: %s, got: %s"
,
n
.
typ
,
typ
))
}
}
n
.
lk
.
RLock
()
n
.
lk
.
RLock
()
...
...
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