~emersion/hut-dev

This thread contains a patchset. You're looking at the original emails, but you may wish to use the patch review UI. Review patch
1

[PATCH] Remove deprecated ioutil package

Details
Message ID
<20220805115341.500486-1-admin@xenrox.net>
DKIM signature
pass
Download raw message
Patch: +7 -10
io/ioutil is deprecated and simply contains wrapper functions to "io" or
"os" [1] since Go 1.16. hut uses a minimum version of 1.17.

[1]: https://godocs.io/io/ioutil
---
 git.go   | 4 ++--
 lists.go | 3 +--
 main.go  | 5 ++---
 meta.go  | 5 ++---
 4 files changed, 7 insertions(+), 10 deletions(-)

diff --git a/git.go b/git.go
index 1147663..d8d85a7 100644
--- a/git.go
+++ b/git.go
@@ -3,7 +3,7 @@ package main
import (
	"context"
	"fmt"
	"io/ioutil"
	"io"
	"log"
	"net/url"
	"os"
@@ -706,7 +706,7 @@ func newGitUpdateCommand() *cobra.Command {
			)

			if readme == "-" {
				b, err = ioutil.ReadAll(os.Stdin)
				b, err = io.ReadAll(os.Stdin)
			} else {
				b, err = os.ReadFile(readme)
			}
diff --git a/lists.go b/lists.go
index 6b0c69d..7453bf3 100644
--- a/lists.go
+++ b/lists.go
@@ -6,7 +6,6 @@ import (
	"errors"
	"fmt"
	"io"
	"io/ioutil"
	"log"
	"net/mail"
	"os"
@@ -213,7 +212,7 @@ func newListsCreateCommand() *cobra.Command {
		var description *string

		if stdin {
			b, err := ioutil.ReadAll(os.Stdin)
			b, err := io.ReadAll(os.Stdin)
			if err != nil {
				log.Fatalf("failed to read mailing list description: %v", err)
			}
diff --git a/main.go b/main.go
index 5156552..c4fc20f 100644
--- a/main.go
+++ b/main.go
@@ -6,7 +6,6 @@ import (
	"errors"
	"fmt"
	"io"
	"io/ioutil"
	"log"
	"os"
	"os/exec"
@@ -148,7 +147,7 @@ func getInputWithEditor(pattern, initialText string) (string, error) {
		return "", errors.New("EDITOR not set")
	}

	file, err := ioutil.TempFile("", pattern)
	file, err := os.CreateTemp("", pattern)
	if err != nil {
		return "", err
	}
@@ -176,7 +175,7 @@ func getInputWithEditor(pattern, initialText string) (string, error) {
		return "", err
	}

	content, err := ioutil.ReadFile(file.Name())
	content, err := os.ReadFile(file.Name())
	if err != nil {
		return "", err
	}
diff --git a/meta.go b/meta.go
index ee9d50e..96f7c1d 100644
--- a/meta.go
+++ b/meta.go
@@ -4,7 +4,6 @@ import (
	"context"
	"errors"
	"fmt"
	"io/ioutil"
	"log"
	"os"
	"os/exec"
@@ -133,7 +132,7 @@ func newMetaSSHKeyCreateCommand() *cobra.Command {
			}
		}

		b, err := ioutil.ReadFile(filename)
		b, err := os.ReadFile(filename)
		if err != nil {
			log.Fatal(err)
		}
@@ -295,7 +294,7 @@ func newMetaPGPKeyCreateCommand() *cobra.Command {
			err      error
		)
		if len(args) > 0 {
			keyBytes, err = ioutil.ReadFile(args[0])
			keyBytes, err = os.ReadFile(args[0])
		} else {
			keyBytes, err = exportDefaultPGPKey(ctx)
		}

base-commit: 721092e97a7bcf33dd472b87d12ac71246c48c2e
-- 
2.37.1
Details
Message ID
<VAcldrop5rNNFaTdYt0H-4E72q_ezwF2yG6KxYmmCNVMfMiQRlqmLP53jC0H4jIJSImgnbrlDzOfwB14LSf2ZLs-z75mHoYwxZ9zUdE2W3A=@emersion.fr>
In-Reply-To
<20220805115341.500486-1-admin@xenrox.net> (view parent)
DKIM signature
pass
Download raw message
Pushed, thanks!
Reply to thread Export thread (mbox)