-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
*: update go-svc #1319
*: update go-svc #1319
Conversation
8fba4bc
to
cfc1f0e
Compare
RFR @mreiferson @ploxiln |
apps/nsqadmin/main.go
Outdated
@@ -9,7 +9,7 @@ import ( | |||
"syscall" | |||
|
|||
"github.com/BurntSushi/toml" | |||
"github.com/judwhite/go-svc/svc" | |||
svc "github.com/judwhite/go-svc" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jehiah I don't think you need the import alias. I'm not using it in the example project
https://github.com/judwhite/go-svc/blob/a2deda217eb3db0e1264c3386d5e41f8c8b08207/example/main.go#L10
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hmmm by convention i expect aliases when the package names doesn't match the directory name (i.e. svc
and go-svc
) but clearly there is more to goimports
logic around this that I don't understand because it doesn't automatically add this alias (but leaves it if it's there).
I think either approach here is ok 🤷♂️
@@ -9,7 +9,7 @@ import ( | |||
"syscall" | |||
|
|||
"github.com/BurntSushi/toml" | |||
"github.com/judwhite/go-svc/svc" | |||
svc "github.com/judwhite/go-svc" | |||
"github.com/mreiferson/go-options" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jehiah You know, it was the early days. Every package started with go-
😆
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
goodness knows I have a bunch of those myself 😢
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jehiah Sometimes I forget to mention what I'm trying to point out 🤦♂️ go-options
(the line I clicked 'Comment' on) is used like options
. It's no big deal, just pointing it out for consistency.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@judwhite That's a good point (and consistency is a compelling argument)
What i didn't know when i wrote this (it took me too long to track this down) is that goimports
does special case the "go-"
prefix when handling import paths; I didn't know that.
6a836a2
to
ad73d05
Compare
p.nsqd.TermSignal() | ||
} | ||
}() | ||
signal.Notify(signalChan, syscall.SIGTERM) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This still feels odd to me that we have to separate out a signal to get the behavior we want. Feels like go-svc
should be able to handle multiple signals, and "programs" can implement a callback act on a received signal and return something to go-svc
indicating whether it should shut down?
This extracts
go-svc
changes out of #1305 and to update the versiongo-svc
we import.