Skip to content
Snippets Groups Projects
Commit f38b7279 authored by Zygmunt Krynicki's avatar Zygmunt Krynicki
Browse files

boot,pieeprom: use Go 1.14 compatible imports


io/fs.ErrNotExist is not available in Go 1.14, we can use the older name
os.ErrNotExist instead.

Signed-off-by: default avatarZygmunt Krynicki <zygmunt.krynicki@huawei.com>
parent e6e5fb47
No related branches found
No related tags found
No related merge requests found
......@@ -22,7 +22,6 @@ package piboot
import (
"errors"
"fmt"
"io/fs"
"os"
"os/exec"
"path/filepath"
......@@ -315,7 +314,7 @@ func (pi *PiBoot) PreInstallHandler(ctx *installhandler.HandlerContext) (err err
tsPath := filepath.Join(pi.procMountPoint, relTsPath)
firmwareBuildTs, err := pieeprom.BuildTimestamp(tsPath)
if err != nil && !errors.Is(err, fs.ErrNotExist) {
if err != nil && !errors.Is(err, os.ErrNotExist) {
return err
}
......
......@@ -5,8 +5,8 @@ package pieeprom_test
import (
"errors"
"io/fs"
"io/ioutil"
"os"
"path/filepath"
"testing"
"time"
......@@ -29,7 +29,7 @@ func (s *eepromSuite) TestBuildTimestamp(c *C) {
// This is what happens on devices without the EEPROM-based firmware.
c.Assert(err, NotNil)
c.Check(errors.Is(err, fs.ErrNotExist), Equals, true)
c.Check(errors.Is(err, os.ErrNotExist), Equals, true)
c.Check(ts.IsZero(), Equals, true)
// Data obtained from a system with firmware programmed with pieeprom-2021-04-29.bin.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment