logs and user messages: use "parse" and "serialize" instead of marshal/unmarshal (#3240)

This commit is contained in:
mmetc 2024-09-17 13:19:14 +02:00 committed by GitHub
parent 1591a0c46e
commit ce085dc4cd
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
56 changed files with 87 additions and 87 deletions

View file

@ -245,7 +245,7 @@ func (p *Papi) Pull() error {
if lastTimestampStr == nil {
binTime, err := lastTimestamp.MarshalText()
if err != nil {
return fmt.Errorf("failed to marshal last timestamp: %w", err)
return fmt.Errorf("failed to serialize last timestamp: %w", err)
}
if err := p.DBClient.SetConfigItem(PapiPullKey, string(binTime)); err != nil {
@ -255,7 +255,7 @@ func (p *Papi) Pull() error {
}
} else {
if err := lastTimestamp.UnmarshalText([]byte(*lastTimestampStr)); err != nil {
return fmt.Errorf("failed to unmarshal last timestamp: %w", err)
return fmt.Errorf("failed to parse last timestamp: %w", err)
}
}
@ -268,7 +268,7 @@ func (p *Papi) Pull() error {
binTime, err := newTime.MarshalText()
if err != nil {
return fmt.Errorf("failed to marshal last timestamp: %w", err)
return fmt.Errorf("failed to serialize last timestamp: %w", err)
}
err = p.handleEvent(event, false)