@@ -65,8 +65,8 @@ func Deserialize(f io.Reader) (opts []*UnitOption, err error) {
6565type lexDataType int
6666
6767const (
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