Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"context"
"encoding/json"
"flag"
"io/ioutil"
"io"
_log "log"
"os"

Expand Down Expand Up @@ -36,7 +36,7 @@ type tConfig struct {
}

func init() {
_log.SetOutput(ioutil.Discard)
_log.SetOutput(io.Discard)

log.SetFormatter(&log.TextFormatter{DisableTimestamp: true})
log.SetOutput(os.Stdout)
Expand All @@ -60,7 +60,7 @@ func main() {
log.SetFormatter(&log.TextFormatter{DisableTimestamp: true})
log.SetOutput(os.Stdout)

content, err := ioutil.ReadFile(configFile)
content, err := os.ReadFile(configFile)
if err != nil {
log.Fatal(err.Error())
}
Expand Down
5 changes: 2 additions & 3 deletions plugin.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import (
"context"
"errors"
"fmt"
"io/ioutil"
"os"
"os/exec"
"path/filepath"
Expand Down Expand Up @@ -46,7 +45,7 @@ func newPlugin(provider *gophercloud.ProviderClient, endpointOpts gophercloud.En
}

if len(config.MachineID) == 0 {
bytes, err := ioutil.ReadFile("/etc/machine-id")
bytes, err := os.ReadFile("/etc/machine-id")
if err != nil {
log.WithError(err).Error("Error reading machine id")
return nil, err
Expand Down Expand Up @@ -346,7 +345,7 @@ func (d plugin) Unmount(r *volume.UnmountRequest) error {
path := filepath.Join(d.config.MountDir, r.Name)
exists, err := isDirectoryPresent(path)
if err != nil {
logger.WithError(err).Error("Error checking directory stat: %s", path)
logger.WithError(err).Errorf("Error checking directory stat: %s", path)
}

if exists {
Expand Down