Check timestamps for files

This commit is contained in:
Alexander Neumann 2014-11-30 22:34:21 +01:00
parent 4246e7602f
commit 3325fa07ea
8 changed files with 229 additions and 17 deletions

View file

@ -236,6 +236,10 @@ func (b *Local) filename(t Type, id ID) string {
// Get returns the content stored under the given ID. If the data doesn't match
// the requested ID, ErrWrongData is returned.
func (b *Local) Get(t Type, id ID) ([]byte, error) {
if id == nil {
return nil, errors.New("unable to load nil ID")
}
// try to open file
file, err := os.Open(b.filename(t, id))
defer file.Close()