mirror of
https://github.com/vbatts/go-mtree.git
synced 2025-07-14 02:39:11 +00:00
*.go: update to golangci-lint, and fix everything
install tools in the workflow actions Also switch away from deprecated ioutil Signed-off-by: Vincent Batts <vbatts@hashbangbash.com>
This commit is contained in:
parent
e7a79ae8a7
commit
42b655d8ee
19 changed files with 101 additions and 78 deletions
|
@ -2,6 +2,7 @@ package mtree
|
|||
|
||||
import (
|
||||
"container/heap"
|
||||
"fmt"
|
||||
"os"
|
||||
"sort"
|
||||
|
||||
|
@ -23,7 +24,12 @@ func Update(root string, dh *DirectoryHierarchy, keywords []Keyword, fs FsEval)
|
|||
creator := dhCreator{DH: dh}
|
||||
curDir, err := os.Getwd()
|
||||
if err == nil {
|
||||
defer os.Chdir(curDir)
|
||||
defer func() {
|
||||
err := os.Chdir(curDir)
|
||||
if err != nil {
|
||||
logrus.Warn(fmt.Errorf("failed to change directory to %q: %w", curDir, err))
|
||||
}
|
||||
}()
|
||||
}
|
||||
|
||||
if err := os.Chdir(root); err != nil {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue