Lint: replace ioutil with os package
This commit is contained in:
parent
685c222b9d
commit
c706523bd0
@ -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
|
||||||
}
|
}
|
||||||
|
@ -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
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user