challenge-sync-airbus: Done

This commit is contained in:
nemunaire 2023-04-06 15:37:05 +02:00
commit 0d5b87b3f7
6 changed files with 73 additions and 68 deletions

View file

@ -2,6 +2,7 @@ package main
import (
"encoding/json"
"log"
"os"
"time"
)
@ -32,6 +33,15 @@ func loadTS(tspath string) (timestamp map[string]*TSValue, err error) {
}
func saveTS(tspath string, ts map[string]*TSValue) error {
if dryRun {
tmp := map[string]TSValue{}
for k, v := range ts {
tmp[k] = *v
}
log.Println("saving TS: ", tmp)
return nil
}
if fd, err := os.Create(tspath); err != nil {
return err
} else {