added config path to Service interface#255
added config path to Service interface#255jasmingacic wants to merge 7 commits intokardianos:masterfrom
Conversation
|
This may be alright. But, the ConfigPath would need to be a separate interface; right now it breaks windows I think. |
|
I haven't tested it with Windows. Do you have a suggestion how to avoid
breaking the build for Windows?
…On Thu, Dec 17, 2020, 18:30 Daniel Theophanes ***@***.***> wrote:
This may be alright. But, the ConfigPath would need to be a separate
interface; right now it breaks windows I think.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#255 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AB7RER3CBVILCWRFDTOKPA3SVI52HANCNFSM4U7ZSOSA>
.
|
|
GOOS=windows go build . |
|
@kardianos Fixed it for windows. I also wanted to check with you if I did it right. In most of cases I renamed |
|
So yes, for this change to happen:
|
|
@kardianos Do you mind if I call the optional interface ConfigInfo? (I can't think of a better name right now) |
|
No. How about hmmm, maybe Not |
|
I think ConfigInfo sound ok then we can have ConfigPath and what other information might be stored there. |
9fa9ee9 to
20d92e3
Compare
|
@kardianos I just refactored it to use the optional interface ConfigInfo, later we can decide on the name. |
kardianos
left a comment
There was a problem hiding this comment.
Ensure you run
go mod tidy
and go fmt
prior to commit.
|
@kardianos can you help me out with the test for ConfigPath how do you want to have it implemented? |
|
Go ahead and read the diffs and correct the other OSes. Also, no need to have an exported method and un-exported method that do the same thing. Just use the exported method. |
|
So getting config value like this is fine? Also I'm not sure what you mean by read the diffs and correct the other OSes, I already did that. Unless I'm missing something. |
kardianos
left a comment
There was a problem hiding this comment.
Please read all my comments carefully this time. Please read your diffs carefully.
| t.Fatalf("New err: %s", err) | ||
| } | ||
|
|
||
| _, err = s.(service.ConfigInfoer).ConfigPath() |
|
ping |
For some sort of automations it is practical to get information where service files are stored.