Skip to content

Commit b046ffc

Browse files
authored
Merge pull request #333 from lucab/ups/unit-unexport
unit: do not export private constants
2 parents cb8b647 + f4046b1 commit b046ffc

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

unit/deserialize.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,8 @@ func Deserialize(f io.Reader) (opts []*UnitOption, err error) {
6565
type lexDataType int
6666

6767
const (
68-
SEC lexDataType = iota
69-
OPT
68+
sectionKind lexDataType = iota
69+
optionKind
7070
)
7171

7272
// lexChanData - support either datatype in the lex channel.
@@ -89,13 +89,13 @@ func deserializeAll(f io.Reader) ([]*UnitSection, []*UnitOption, error) {
8989

9090
for ld := range lexchan {
9191
switch ld.Type {
92-
case OPT:
92+
case optionKind:
9393
if ld.Option != nil {
9494
// add to options
9595
opt := ld.Option
9696
options = append(options, &(*opt))
9797

98-
// sanity check. "should not happen" as SEC is first in code flow.
98+
// sanity check. "should not happen" as sectionKind is first in code flow.
9999
if len(sections) == 0 {
100100
return nil, nil, fmt.Errorf(
101101
"Unit file misparse: option before section")
@@ -106,7 +106,7 @@ func deserializeAll(f io.Reader) ([]*UnitSection, []*UnitOption, error) {
106106
sections[s].Entries = append(sections[s].Entries,
107107
&UnitEntry{Name: opt.Name, Value: opt.Value})
108108
}
109-
case SEC:
109+
case sectionKind:
110110
if ld.Section != nil {
111111
sections = append(sections, ld.Section)
112112
}
@@ -189,7 +189,7 @@ func (l *lexer) lexSectionSuffixFunc(section string) lexStep {
189189
}
190190

191191
l.lexchan <- &lexData{
192-
Type: SEC,
192+
Type: sectionKind,
193193
Section: &UnitSection{Section: section, Entries: []*UnitEntry{}},
194194
Option: nil,
195195
}
@@ -321,7 +321,7 @@ func (l *lexer) lexOptionValueFunc(section, name string, partial bytes.Buffer) l
321321
val = strings.TrimSpace(val)
322322
}
323323
l.lexchan <- &lexData{
324-
Type: OPT,
324+
Type: optionKind,
325325
Section: nil,
326326
Option: &UnitOption{Section: section, Name: name, Value: val},
327327
}

0 commit comments

Comments
 (0)