Lint: replace ioutil with os package

This commit is contained in:
Dan Sosedoff 2022-11-14 15:47:36 -06:00
parent 685c222b9d
commit c706523bd0
No known key found for this signature in database
GPG Key ID: 26186197D282B164
2 changed files with 4 additions and 5 deletions

View File

@ -2,7 +2,7 @@ package bookmarks
import ( import (
"fmt" "fmt"
"io/ioutil" "os"
"path/filepath" "path/filepath"
"strings" "strings"
@ -46,7 +46,7 @@ func (b Bookmark) ConvertToOptions() command.Options {
func readServerConfig(path string) (Bookmark, error) { func readServerConfig(path string) (Bookmark, error) {
bookmark := Bookmark{} bookmark := Bookmark{}
buff, err := ioutil.ReadFile(path) buff, err := os.ReadFile(path)
if err != nil { if err != nil {
return bookmark, err return bookmark, err
} }
@ -100,7 +100,7 @@ func Path(overrideDir string) string {
func ReadAll(path string) (map[string]Bookmark, error) { func ReadAll(path string) (map[string]Bookmark, error) {
results := map[string]Bookmark{} results := map[string]Bookmark{}
files, err := ioutil.ReadDir(path) files, err := os.ReadDir(path)
if err != nil { if err != nil {
return results, err return results, err
} }

View File

@ -4,7 +4,6 @@ import (
"errors" "errors"
"fmt" "fmt"
"io" "io"
"io/ioutil"
"log" "log"
"net" "net"
"net/url" "net/url"
@ -54,7 +53,7 @@ func fileExists(path string) bool {
} }
func parsePrivateKey(keyPath string, keyPass string) (ssh.Signer, error) { func parsePrivateKey(keyPath string, keyPass string) (ssh.Signer, error) {
buff, err := ioutil.ReadFile(keyPath) buff, err := os.ReadFile(keyPath)
if err != nil { if err != nil {
return nil, err return nil, err
} }