@ -340,7 +340,7 @@ func (p *PromParser) Next() (Entry, error) {
t2 = p . nextToken ( )
t2 = p . nextToken ( )
}
}
if t2 != tValue {
if t2 != tValue {
return EntryInvalid , parseError ( "expected value after metric" , t )
return EntryInvalid , parseError ( "expected value after metric" , t 2 )
}
}
if p . val , err = parseFloat ( yoloString ( p . l . buf ( ) ) ) ; err != nil {
if p . val , err = parseFloat ( yoloString ( p . l . buf ( ) ) ) ; err != nil {
return EntryInvalid , err
return EntryInvalid , err
@ -350,7 +350,7 @@ func (p *PromParser) Next() (Entry, error) {
p . val = math . Float64frombits ( value . NormalNaN )
p . val = math . Float64frombits ( value . NormalNaN )
}
}
p . hasTS = false
p . hasTS = false
switch p. nextToken ( ) {
switch t := p. nextToken ( ) ; t {
case tLinebreak :
case tLinebreak :
break
break
case tTimestamp :
case tTimestamp :
@ -359,7 +359,7 @@ func (p *PromParser) Next() (Entry, error) {
return EntryInvalid , err
return EntryInvalid , err
}
}
if t2 := p . nextToken ( ) ; t2 != tLinebreak {
if t2 := p . nextToken ( ) ; t2 != tLinebreak {
return EntryInvalid , parseError ( "expected next entry after timestamp" , t )
return EntryInvalid , parseError ( "expected next entry after timestamp" , t 2 )
}
}
default :
default :
return EntryInvalid , parseError ( "expected timestamp or new record" , t )
return EntryInvalid , parseError ( "expected timestamp or new record" , t )