From 02875cef9010633b6689cfd1e2ceec9107b756b4 Mon Sep 17 00:00:00 2001 From: Eric Biggers Date: Sun, 4 Dec 2022 13:27:43 -0800 Subject: Stop using deprecated package io/ioutil Since Go 1.16 (which recently became the minimum supported Go version for this project), the package io/ioutil is deprecated in favor of equivalent functionality in the io and os packages. staticcheck warns about this. Address all the warnings by switching to the non-deprecated replacement functions. --- pam_fscrypt/run_fscrypt.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'pam_fscrypt') diff --git a/pam_fscrypt/run_fscrypt.go b/pam_fscrypt/run_fscrypt.go index db86d01..af9537f 100644 --- a/pam_fscrypt/run_fscrypt.go +++ b/pam_fscrypt/run_fscrypt.go @@ -31,7 +31,6 @@ import "C" import ( "fmt" "io" - "io/ioutil" "log" "log/syslog" "os" @@ -132,7 +131,7 @@ func parseArgs(argc C.int, argv **C.char) map[string]bool { // syslog. func setupLogging(args map[string]bool) io.Writer { log.SetFlags(0) // Syslog already includes time data itself - log.SetOutput(ioutil.Discard) + log.SetOutput(io.Discard) if args[debugFlag] { debugWriter, err := syslog.New(syslog.LOG_DEBUG, moduleName) if err == nil { @@ -142,7 +141,7 @@ func setupLogging(args map[string]bool) io.Writer { errorWriter, err := syslog.New(syslog.LOG_ERR, moduleName) if err != nil { - return ioutil.Discard + return io.Discard } return errorWriter } -- cgit v1.2.3