Skip to content

unit file getter function #97

@miekg

Description

@miekg

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions