remove accidentally commited debug code. fix ioutil deprecations

This commit is contained in:
ungrentquest
2025-04-20 21:53:37 +00:00
parent 2fd20db19b
commit 10d4baefaa
2 changed files with 2 additions and 13 deletions

View File

@ -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)
}
}

View File

@ -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
}