Skip to content
New issue

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

Initialize App when creating new server #1

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

harlow
Copy link

@harlow harlow commented Oct 28, 2017

While trying to run connect-kafka I was getting a panic from within the connect package.

Looks like App needs to be initialized:

api := &Server{processFunc: p, App: app.New()}

Otherwise it will panic when trying to use the Log middleware:

panic: runtime error: invalid memory address or nil pointer dereference [recovered]
	panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x1236fef]

goroutine 5 [running]:
testing.tRunner.func1(0xc4201080f0)
	/usr/local/Cellar/go/1.9.1/libexec/src/testing/testing.go:711 +0x2d2
panic(0x128ff00, 0x145caf0)
	/usr/local/Cellar/go/1.9.1/libexec/src/runtime/panic.go:491 +0x283
github.com/gohttp/app.(*App).Use(0x0, 0xc42000e038, 0x1, 0x1)
	/Users/harlow/code/go/src/github.com/gohttp/app/app.go:28 +0x13f
github.com/harlow/connect/internal/api.NewHttpServer(0x12f6160, 0x156f71)
	/Users/harlow/code/go/src/github.com/harlow/connect/internal/api/httpserver.go:25 +0xba
github.com/harlow/connect/internal/api.TestNewHttpServer(0xc4201080f0)
	/Users/harlow/code/go/src/github.com/harlow/connect/internal/api/httpserver_test.go:13 +0x2d
testing.tRunner(0xc4201080f0, 0x12f6168)
	/usr/local/Cellar/go/1.9.1/libexec/src/testing/testing.go:746 +0xd0
created by testing.(*T).Run
	/usr/local/Cellar/go/1.9.1/libexec/src/testing/testing.go:789 +0x2de
exit status 2

@harlow
Copy link
Author

harlow commented Nov 22, 2017

ping @vinceprignano any chance we can get this merged?

ran into this issue when creating: segment-integrations/connect-kafka#3

@f2prateek f2prateek requested a review from ivolo November 22, 2017 18:41
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.

None yet

1 participant