Skip to content

Commit 1f50a5e

Browse files
committed
unit: add NewUnitOption convenience function
1 parent d7b0894 commit 1f50a5e

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

unit/option.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,10 @@ type UnitOption struct {
2424
Value string
2525
}
2626

27+
func NewUnitOption(section, name, value string) *UnitOption {
28+
return &UnitOption{Section: section, Name: name, Value: value}
29+
}
30+
2731
func (uo *UnitOption) String() string {
2832
return fmt.Sprintf("{Section: %q, Name: %q, Value: %q}", uo.Section, uo.Name, uo.Value)
2933
}

0 commit comments

Comments
 (0)