chore: modernize go sources (#24896)

This commit is contained in:
andig 2025-10-31 16:25:53 +01:00 • committed by GitHub
parent 3421e8df81
commit 352012d24b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
324 changed files with 590 additions and 583 deletions

View file

@ -52,7 +52,7 @@ func (s *DB) New(meter float64) *Session {
}
// Persist creates or updates a transaction in the database
func (s *DB) Persist(session interface{}) {
func (s *DB) Persist(session any) {
if err := s.db.Save(session).Error; err != nil {
s.log.ERROR.Printf("persist: %v", err)
}
@ -68,7 +68,7 @@ func (s *DB) Sessions() (Sessions, error) {
func (s *DB) ClosePendingSessionsInHistory(chargeMeterTotal float64) error {
var res Sessions
if tx := s.db.Find(&res, map[string]interface{}{"finished": "0001-01-01 00:00:00+00:00", "Loadpoint": s.name}); tx.Error != nil {
if tx := s.db.Find(&res, map[string]any{"finished": "0001-01-01 00:00:00+00:00", "Loadpoint": s.name}); tx.Error != nil {
return tx.Error
}