mirror of
https://github.com/go-i2p/newsgo.git
synced 2025-06-17 06:35:31 -04:00
remove accidentally commited debug code. fix ioutil deprecations
This commit is contained in:
12
cmd/build.go
12
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)
|
||||
}
|
||||
}
|
||||
|
@ -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
|
||||
}
|
||||
|
Reference in New Issue
Block a user