@@ -65,8 +65,8 @@ func Deserialize(f io.Reader) (opts []*UnitOption, err error) {
65
65
type lexDataType int
66
66
67
67
const (
68
- SEC lexDataType = iota
69
- OPT
68
+ sectionKind lexDataType = iota
69
+ optionKind
70
70
)
71
71
72
72
// lexChanData - support either datatype in the lex channel.
@@ -89,13 +89,13 @@ func deserializeAll(f io.Reader) ([]*UnitSection, []*UnitOption, error) {
89
89
90
90
for ld := range lexchan {
91
91
switch ld .Type {
92
- case OPT :
92
+ case optionKind :
93
93
if ld .Option != nil {
94
94
// add to options
95
95
opt := ld .Option
96
96
options = append (options , & (* opt ))
97
97
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.
99
99
if len (sections ) == 0 {
100
100
return nil , nil , fmt .Errorf (
101
101
"Unit file misparse: option before section" )
@@ -106,7 +106,7 @@ func deserializeAll(f io.Reader) ([]*UnitSection, []*UnitOption, error) {
106
106
sections [s ].Entries = append (sections [s ].Entries ,
107
107
& UnitEntry {Name : opt .Name , Value : opt .Value })
108
108
}
109
- case SEC :
109
+ case sectionKind :
110
110
if ld .Section != nil {
111
111
sections = append (sections , ld .Section )
112
112
}
@@ -189,7 +189,7 @@ func (l *lexer) lexSectionSuffixFunc(section string) lexStep {
189
189
}
190
190
191
191
l .lexchan <- & lexData {
192
- Type : SEC ,
192
+ Type : sectionKind ,
193
193
Section : & UnitSection {Section : section , Entries : []* UnitEntry {}},
194
194
Option : nil ,
195
195
}
@@ -321,7 +321,7 @@ func (l *lexer) lexOptionValueFunc(section, name string, partial bytes.Buffer) l
321
321
val = strings .TrimSpace (val )
322
322
}
323
323
l .lexchan <- & lexData {
324
- Type : OPT ,
324
+ Type : optionKind ,
325
325
Section : nil ,
326
326
Option : & UnitOption {Section : section , Name : name , Value : val },
327
327
}
0 commit comments