*: update go-svc#1319
Conversation
8fba4bc to
cfc1f0e
Compare
|
RFR @mreiferson @ploxiln |
|
|
||
| "github.com/BurntSushi/toml" | ||
| "github.com/judwhite/go-svc/svc" | ||
| svc "github.com/judwhite/go-svc" |
There was a problem hiding this comment.
@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.
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 🤷♂️
| "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.
@jehiah You know, it was the early days. Every package started with go- 😆
There was a problem hiding this comment.
goodness knows I have a bunch of those myself 😢
There was a problem hiding this comment.
@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.
@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.
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-svcchanges out of #1305 and to update the versiongo-svcwe import.