Skip to content
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

unit file getter function #97

Open
miekg opened this issue Feb 3, 2021 · 0 comments
Open

unit file getter function #97

miekg opened this issue Feb 3, 2021 · 0 comments
Labels
good first issue Good for newcomers

Comments

@miekg
Copy link
Collaborator

miekg commented Feb 3, 2021

Right now we have a bunch of write functions for unit file Overwrite, Delete and Insert we don't have a Read function, so there is a bunch of u.Contents["Service"]["ExecStart"] to get to a value.

An Getter function would be nice here, maybe:

// Content returns the values set in section, under name. If not found nil is returned.
func (u *File) Content(section, name string) []string { .... }

Should be added in internal/unit/file.go and then all callers should be updated.

@miekg miekg added the good first issue Good for newcomers label Feb 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

1 participant