Fix: make os.Stat return correct err on provider
This commit is contained in:
parent
5628f97da1
commit
008731c249
1 changed files with 6 additions and 4 deletions
|
@ -35,10 +35,12 @@ func (f *fetcher) VehicleType() VehicleType {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (f *fetcher) Initial() (interface{}, error) {
|
func (f *fetcher) Initial() (interface{}, error) {
|
||||||
var buf []byte
|
var (
|
||||||
var err error
|
buf []byte
|
||||||
var isLocal bool
|
err error
|
||||||
if stat, err := os.Stat(f.vehicle.Path()); err == nil {
|
isLocal bool
|
||||||
|
)
|
||||||
|
if stat, fErr := os.Stat(f.vehicle.Path()); fErr == nil {
|
||||||
buf, err = ioutil.ReadFile(f.vehicle.Path())
|
buf, err = ioutil.ReadFile(f.vehicle.Path())
|
||||||
modTime := stat.ModTime()
|
modTime := stat.ModTime()
|
||||||
f.updatedAt = &modTime
|
f.updatedAt = &modTime
|
||||||
|
|
Loading…
Reference in a new issue