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
added config path to Service interface #255
base: master
Are you sure you want to change the base?
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. |
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.
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. |
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.
Please read all my comments carefully this time. Please read your diffs carefully.
t.Fatalf("New err: %s", err) | ||
} | ||
|
||
_, err = s.(service.ConfigInfoer).ConfigPath() |
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.
Is this test valid?
ping |
For some sort of automations it is practical to get information where service files are stored.