mirror of
https://github.com/ipfs/kubo.git
synced 2026-02-25 04:17:44 +08:00
rm unused function
This commit is contained in:
parent
9a7fbe3210
commit
acbd9a2204
@ -43,23 +43,6 @@ func writeConfigFile(filename string, cfg interface{}) error {
|
||||
return encode(f, cfg)
|
||||
}
|
||||
|
||||
// writeFile writes the buffer at filename
|
||||
func writeFile(filename string, buf []byte) error {
|
||||
err := os.MkdirAll(filepath.Dir(filename), 0775)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
f, err := os.Create(filename)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
defer f.Close()
|
||||
|
||||
_, err = f.Write(buf)
|
||||
return err
|
||||
}
|
||||
|
||||
// encode configuration with JSON
|
||||
func encode(w io.Writer, value interface{}) error {
|
||||
// need to prettyprint, hence MarshalIndent, instead of Encoder
|
||||
|
||||
Loading…
Reference in New Issue
Block a user