From 10d4baefaa0e89f17df77ca53734de336def347c Mon Sep 17 00:00:00 2001 From: ungrentquest Date: Sun, 20 Apr 2025 21:53:37 +0000 Subject: [PATCH] remove accidentally commited debug code. fix ioutil deprecations --- cmd/build.go | 12 +----------- cmd/sign.go | 3 +-- 2 files changed, 2 insertions(+), 13 deletions(-) diff --git a/cmd/build.go b/cmd/build.go index e03cf54..d48d738 100644 --- a/cmd/build.go +++ b/cmd/build.go @@ -1,9 +1,6 @@ package cmd import ( - "encoding/json" - "fmt" - "io/ioutil" "log" "os" "path/filepath" @@ -24,13 +21,6 @@ var buildCmd = &cobra.Command{ // For some reason this is the only way passing booleans from cobra to viper works viper.GetViper().Set("i2p", i2p) - viper.WriteConfigTo(os.Stdout) - viper.Unmarshal(c) - data, _ := json.MarshalIndent(&c, " ", "") - fmt.Print(string(data[:])) - - os.Exit(0) - f, e := os.Stat(c.NewsFile) if e != nil { panic(e) @@ -113,7 +103,7 @@ func build(newsFile string) { if err := os.MkdirAll(filepath.Join(c.BuildDir, filepath.Dir(filename)), 0755); err != nil { panic(err) } - if err = ioutil.WriteFile(filepath.Join(c.BuildDir, filename), []byte(feed), 0644); err != nil { + if err = os.WriteFile(filepath.Join(c.BuildDir, filename), []byte(feed), 0644); err != nil { panic(err) } } diff --git a/cmd/sign.go b/cmd/sign.go index c4e257a..f101576 100644 --- a/cmd/sign.go +++ b/cmd/sign.go @@ -4,7 +4,6 @@ import ( "crypto/rsa" "crypto/x509" "encoding/pem" - "io/ioutil" "log" "os" "path/filepath" @@ -59,7 +58,7 @@ func init() { } func loadPrivateKey(path string) (*rsa.PrivateKey, error) { - privPem, err := ioutil.ReadFile(path) + privPem, err := os.ReadFile(path) if nil != err { return nil, err }