# HG changeset patch
# Node ID ca04079e6047
# Parent  9f9a854ed3b3
diff --git a/access/access.go b/access/access.go
--- a/access/access.go
+++ b/access/access.go
@@ -1,7 +1,6 @@
 package access
 
 import (
-	"io/ioutil"
 	"os"
 	"path/filepath"
 	"strings"
@@ -32,7 +31,7 @@ func Setup(repositoriesPath, adminRepo s
 	adminRepoName = adminRepo
 	adminRepoPath = filepath.Join(reposPath, adminRepo)
 
-	configPath, err := ioutil.TempFile("", "hgkeeper-hgweb-access-*.config")
+	configPath, err := os.CreateTemp("", "hgkeeper-hgweb-access-*.config")
 	if err != nil {
 		return err
 	}
diff --git a/access/users.go b/access/users.go
--- a/access/users.go
+++ b/access/users.go
@@ -2,7 +2,6 @@ package access
 
 import (
 	"fmt"
-	"io/ioutil"
 	"os"
 	"path/filepath"
 	"strings"
@@ -38,13 +37,13 @@ func refreshKeys() error {
 		}
 	}
 
-	entries, err := ioutil.ReadDir(keysPath)
+	entries, err := os.ReadDir(keysPath)
 	if err != nil {
 		return err
 	}
 
 	for _, entry := range entries {
-		if entry.Mode().IsRegular() {
+		if entry.Type().IsRegular() {
 			filename := filepath.Join(keysPath, entry.Name())
 			loadSshKey(filename, entry.Name())
 		}
@@ -54,7 +53,7 @@ func refreshKeys() error {
 }
 
 func loadSshKey(filename, username string) {
-	buffer, err := ioutil.ReadFile(filename)
+	buffer, err := os.ReadFile(filename)
 	if err != nil {
 		zap.S().Warnf("failed to read keyfile for user %s: %v", username, err)
 		return
diff --git a/hg/hgrc.go b/hg/hgrc.go
--- a/hg/hgrc.go
+++ b/hg/hgrc.go
@@ -1,7 +1,7 @@
 package hg
 
 import (
-	"io/ioutil"
+	"os"
 	"path/filepath"
 
 	"gopkg.in/ini.v1"
@@ -10,7 +10,7 @@ import (
 )
 
 func createHgrc(writeable bool) (string, error) {
-	tmpfile, err := ioutil.TempFile("", "hgkeeper-*.hgrc")
+	tmpfile, err := os.CreateTemp("", "hgkeeper-*.hgrc")
 	if err != nil {
 		return "", err
 	}
diff --git a/hgweb/hgweb.go b/hgweb/hgweb.go
--- a/hgweb/hgweb.go
+++ b/hgweb/hgweb.go
@@ -2,7 +2,6 @@ package hgweb
 
 import (
 	"embed"
-	"io/ioutil"
 	"net/http"
 	"net/http/cgi"
 	"os"
@@ -25,7 +24,7 @@ func New() *HGWeb {
 }
 
 func (hgw *HGWeb) createConfig() error {
-	configPath, err := ioutil.TempFile("", "hgkeeper-hgweb-*.config")
+	configPath, err := os.CreateTemp("", "hgkeeper-hgweb-*.config")
 	if err != nil {
 		return err
 	}
@@ -53,7 +52,7 @@ func (hgw *HGWeb) createConfig() error {
 }
 
 func (hgw *HGWeb) createCGI() error {
-	cgiPath, err := ioutil.TempFile("", "hgkeeper-hgweb-*.cgi")
+	cgiPath, err := os.CreateTemp("", "hgkeeper-hgweb-*.cgi")
 	if err != nil {
 		return err
 	}
diff --git a/setup/command.go b/setup/command.go
--- a/setup/command.go
+++ b/setup/command.go
@@ -4,7 +4,6 @@ import (
 	"embed"
 	"fmt"
 	"io/fs"
-	"io/ioutil"
 	"os"
 	"path/filepath"
 	"strings"
@@ -120,7 +119,7 @@ func (c *Command) createAdminRepo(reposP
 				return err
 			}
 
-			if err := ioutil.WriteFile(absname, data, 0644); err != nil {
+			if err := os.WriteFile(absname, data, 0644); err != nil {
 				return err
 			}
 		}
@@ -148,7 +147,7 @@ func (c *Command) createAdminRepo(reposP
 	}
 
 	// now copy the admin key into the keys directory
-	pubkey, err := ioutil.ReadFile(c.AdminSSHPubkey)
+	pubkey, err := os.ReadFile(c.AdminSSHPubkey)
 	if err != nil {
 		return err
 	}
@@ -160,7 +159,7 @@ func (c *Command) createAdminRepo(reposP
 	}
 
 	filenames = append(filenames, relAdminPubkey)
-	if err := ioutil.WriteFile(adminPubkey, pubkey, 0644); err != nil {
+	if err := os.WriteFile(adminPubkey, pubkey, 0644); err != nil {
 		return err
 	}
 
@@ -178,7 +177,7 @@ func (c *Command) createAdminRepo(reposP
 }
 
 func isPubkey(filename string) error {
-	bytes, err := ioutil.ReadFile(filename)
+	bytes, err := os.ReadFile(filename)
 	if err != nil {
 		return err
 	}
diff --git a/ssh/keys.go b/ssh/keys.go
--- a/ssh/keys.go
+++ b/ssh/keys.go
@@ -2,7 +2,7 @@ package ssh
 
 import (
 	"errors"
-	"io/ioutil"
+	"os"
 	"path/filepath"
 
 	"go.uber.org/zap"
@@ -10,7 +10,7 @@ import (
 )
 
 func (s *Server) setHostKeysPath(hostKeysPath string) error {
-	files, err := ioutil.ReadDir(hostKeysPath)
+	files, err := os.ReadDir(hostKeysPath)
 	if err != nil {
 		return err
 	}
@@ -18,10 +18,10 @@ func (s *Server) setHostKeysPath(hostKey
 	found := false
 
 	for _, file := range files {
-		if !file.Mode().IsDir() {
+		if !file.IsDir() {
 			path := filepath.Join(hostKeysPath, file.Name())
 
-			data, err := ioutil.ReadFile(path)
+			data, err := os.ReadFile(path)
 			if err != nil {
 				zap.S().Warnf("failed to read %s", path)
 				continue
