Skip to content

Conversation

@rogaha
Copy link
Contributor

@rogaha rogaha commented Nov 14, 2015

No description provided.

@ckingdev
Copy link
Owner

What problems are occurring with strings that json.Number solves?

@rogaha
Copy link
Contributor Author

rogaha commented Nov 16, 2015

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

json.Number supports unmarshmaling numbers into strings.

@rogaha
Copy link
Contributor Author

rogaha commented Nov 19, 2015

I found the issue. It's on the CommitType.ID. We need to change it int. Closing it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants