Replaced string with json.Number to avoid unmarshal convertion errors#2
Open
rogaha wants to merge 33 commits intockingdev:masterfrom
Open
Replaced string with json.Number to avoid unmarshal convertion errors#2rogaha wants to merge 33 commits intockingdev:masterfrom
rogaha wants to merge 33 commits intockingdev:masterfrom
Conversation
Owner
|
What problems are occurring with strings that json.Number solves? |
Contributor
Author
|
To avoid this: panic: json: cannot unmarshal number into Go value of type string
goroutine 587 [running]:
runtime.panic(0x6dc140, 0xc2100d1c40)
/usr/lib/go/src/pkg/runtime/panic.c:266 +0xb6
github.com/rogaha/gohook.(*Server).processPacket(0xc21001ed50, 0xc21017aa80, 0xe, 0xc210093000, 0x1c28, ...)
/go/src/github.com/rogaha/gohook/server.go:103 +0x1fc
created by github.com/rogaha/gohook.(*Server).ServeHTTP
/go/src/github.com/rogaha/gohook/server.go:143 +0x321
goroutine 1 [IO wait]:
net.runtime_pollWait(0x7fd72d563790, 0x72, 0x0)
/usr/lib/go/src/pkg/runtime/netpoll.goc:116 +0x6a
net.(*pollDesc).Wait(0xc210050530, 0x72, 0x7fd72d562098, 0xb)
/usr/lib/go/src/pkg/net/fd_poll_runtime.go:81 +0x34
net.(*pollDesc).WaitRead(0xc210050530, 0xb, 0x7fd72d562098)
/usr/lib/go/src/pkg/net/fd_poll_runtime.go:86 +0x30
net.(*netFD).accept(0xc2100504d0, 0x813dc0, 0x0, 0x7fd72d562098, 0xb)
/usr/lib/go/src/pkg/net/fd_unix.go:382 +0x2c2
net.(*TCPListener).AcceptTCP(0xc2100002d0, 0x46aaeb, 0x7fd72d3c2478, 0x46aaeb)
/usr/lib/go/src/pkg/net/tcpsock_posix.go:233 +0x47
net.(*TCPListener).Accept(0xc2100002d0, 0x7fd72d563838, 0xc21012e800, 0xc2100d8680, 0x0)
/usr/lib/go/src/pkg/net/tcpsock_posix.go:243 +0x27
net/http.(*Server).Serve(0xc21001f500, 0x7fd72d5627f0, 0xc2100002d0, 0x0, 0x0)
/usr/lib/go/src/pkg/net/http/server.go:1622 +0x91
net/http.(*Server).ListenAndServe(0xc21001f500, 0xc21001f500, 0x7fd72d562770)
/usr/lib/go/src/pkg/net/http/server.go:1612 +0xa0
net/http.ListenAndServe(0xc2100002a8, 0x3, 0x7fd72d562770, 0xc21001f460, 0x1, ...)
/usr/lib/go/src/pkg/net/http/server.go:1677 +0x6d
main.func·002(0xc21006e6c0)
/hydra/webhooks/main.go:79 +0xbc7
github.com/codegangsta/cli.(*App).Run(0xc21006e5a0, 0xc21000a000, 0x1, 0x1, 0x0, ...)
/go/src/github.com/codegangsta/cli/app.go:180 +0xe4b
main.main()
/hydra/webhooks/main.go:83 +0x726
goroutine 3 [chan receive]:
database/sql.(*DB).connectionOpener(0xc21006f400)
/usr/lib/go/src/pkg/database/sql/sql.go:574 +0x3e
created by database/sql.Open
/usr/lib/go/src/pkg/database/sql/sql.go:436 +0x24d
goroutine 4 [chan receive]:
main.HandleGithubEvents(0xc21006f300, 0xc21006f400)
/hydra/webhooks/github.go:13 +0x4e
created by main.func·002
/hydra/webhooks/main.go:74 +0x9ee
goroutine 11 [syscall]:
runtime.goexit()
/usr/lib/go/src/pkg/runtime/proc.c:1394
|
Contributor
Author
|
I found the issue. It's on the |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.