challenge-sync-airbus: Done
This commit is contained in:
parent
268925db0d
commit
0d5b87b3f7
6 changed files with 73 additions and 68 deletions
|
|
@ -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 {
|
||||
|
|
|
|||
Reference in a new issue