From 43c705325c525f8bcaefb94403035d438163bb3b Mon Sep 17 00:00:00 2001 From: CatalinStratu Date: Sun, 6 Aug 2023 13:30:45 +0300 Subject: [PATCH 1/2] Package Ioutil is deprecated --- main.go | 3 +-- objfile/disasm.go | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/main.go b/main.go index 8ed1039..f98b360 100644 --- a/main.go +++ b/main.go @@ -7,7 +7,6 @@ import ( "encoding/json" "flag" "fmt" - "io/ioutil" "log" "os" "strings" @@ -105,7 +104,7 @@ func main_impl(fileName string, printStdPkgs bool, printFilePaths bool, printTyp extractMetadata.Arch = file.GOARCH() } - fileData, fileDataErr := ioutil.ReadFile(fileName) + fileData, fileDataErr := os.ReadFile(fileName) if fileDataErr == nil { // GOVERSION diff --git a/objfile/disasm.go b/objfile/disasm.go index c6409c7..3afaece 100644 --- a/objfile/disasm.go +++ b/objfile/disasm.go @@ -13,7 +13,6 @@ import ( "encoding/binary" "fmt" "io" - "io/ioutil" "os" "path/filepath" "regexp" @@ -160,7 +159,7 @@ func (fc *FileCache) Line(filename string, line int) ([]byte, error) { } if e == nil { - content, err := ioutil.ReadFile(filename) + content, err := os.ReadFile(filename) if err != nil { return nil, err } From e2b0b665dff1c57ce13c7a59393f4f8d03b0294f Mon Sep 17 00:00:00 2001 From: CatalinStratu Date: Sun, 6 Aug 2023 13:54:22 +0300 Subject: [PATCH 2/2] Add .idea file in gitignore --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index d5cc500..c99a30f 100644 --- a/.gitignore +++ b/.gitignore @@ -14,6 +14,7 @@ test/ GoReSym Dockerfile.test +.idea # Dependency directories (remove the comment below to include it) # vendor/