X-Git-Url: https://ruderich.org/simon/gitweb/?a=blobdiff_plain;f=state.go;h=4b3124137530213e5444867c797afa29e3ff5dea;hb=1002c514a8530bb6608c556b4446e853be390917;hp=fa8dccd60cfb56974f6a03d58eedae5c06f76b0f;hpb=b8abeed6c7bddb9d9770f3be93dc41400354783b;p=nsscash%2Fnsscash.git diff --git a/state.go b/state.go index fa8dccd..4b31241 100644 --- a/state.go +++ b/state.go @@ -1,6 +1,6 @@ // Read and write the state file used to keep data over multiple runs -// Copyright (C) 2019 Simon Ruderich +// Copyright (C) 2019-2020 Simon Ruderich // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by @@ -26,7 +26,9 @@ import ( ) type State struct { + // Key is File.Url LastModified map[string]time.Time + Checksum map[string]string // SHA512 in hex } func LoadState(path string) (*State, error) { @@ -49,6 +51,9 @@ func LoadState(path string) (*State, error) { if state.LastModified == nil { state.LastModified = make(map[string]time.Time) } + if state.Checksum == nil { + state.Checksum = make(map[string]string) + } return &state, nil }