-
Notifications
You must be signed in to change notification settings - Fork 227
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
bind forces the user to have a -bind flag #47
Comments
By override do you mean "specify the port in the application itself" or On Sunday, July 20, 2014, Jesús García Crespo notifications@github.com
|
I meant the former, in my particular case I just don't want to use |
Confirmed, it panics! See http://golang.org/src/pkg/flag/flag.go?s=22344:22405#L661. |
You can use https://godoc.org/github.com/zenazn/goji/graceful#ListenAndServe to i.e. r := web.New() graceful.ListenAndServe(":8000", r) This is exactly what I do. On Sunday, July 20, 2014, Jesús García Crespo notifications@github.com
|
Yeah, I'm doing something similar. I'm assuming you also make use of the
|
I don't use the -bind flag myself. Using graceful.ListenAndServe to explicitly specify a port does not ./wwg2 -help Notice that -bind isn't an available option. On Sunday, July 20, 2014, Jesús García Crespo notifications@github.com
|
Oh, I see! I was importing goji because of DefaultMux but I guess I can just build my own Mux object. Thank you! Should I close this issue? |
So like elithrar mentioned, the project is structured in such a way that using the top-level I've considered making |
I agree. I think that the current project structure is brilliant. |
Expose an additional function, bind.WithFlag(), which allows callers to use the previously-default "global flag" mode. This change allows the bind string parser (etc.) to be used without unwanted side effects. The behavior of the top-level "goji" package has not been changed. Fixes #47.
Alright, |
I like it. |
This is a better way to do things since we were customizing middleware and everything anyway. It's also necessary in order to avoid pulling in the default Goji -bind flag: zenazn/goji#47
bind is fantastic, but it defines a
-bind
cli flag even when you are not making use of it. I'm aware that people out there may be relying on that specific behaviour but it would be nice to have a mechanism to override it, any ideas?The text was updated successfully, but these errors were encountered: