diff options
author | zelig <viktor.tron@gmail.com> | 2015-03-25 22:58:52 +0800 |
---|---|---|
committer | zelig <viktor.tron@gmail.com> | 2015-03-27 03:00:18 +0800 |
commit | 4ec38e39320ee9abccd96da765a9c65fccd04151 (patch) | |
tree | 3f57aebae8bd42f766b80a3db5e3b22328e9a181 /cmd/mist | |
parent | 23e41a57ad7e7cb4bc5a1cbad28bbf8d65907fdd (diff) | |
download | go-tangerine-4ec38e39320ee9abccd96da765a9c65fccd04151.tar.gz go-tangerine-4ec38e39320ee9abccd96da765a9c65fccd04151.tar.zst go-tangerine-4ec38e39320ee9abccd96da765a9c65fccd04151.zip |
common: remove WriteFile and ReadAllFile (use ioutil instead)
Diffstat (limited to 'cmd/mist')
-rw-r--r-- | cmd/mist/bindings.go | 7 | ||||
-rw-r--r-- | cmd/mist/gui.go | 5 |
2 files changed, 7 insertions, 5 deletions
diff --git a/cmd/mist/bindings.go b/cmd/mist/bindings.go index 8a9ec7cb1..e7ce50c35 100644 --- a/cmd/mist/bindings.go +++ b/cmd/mist/bindings.go @@ -22,13 +22,14 @@ package main import ( "encoding/json" + "io/ioutil" "os" "strconv" "github.com/ethereum/go-ethereum/cmd/utils" "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/core/state" + "github.com/ethereum/go-ethereum/core/types" ) type plugin struct { @@ -46,14 +47,14 @@ func (self *Gui) AddPlugin(pluginPath string) { self.plugins[pluginPath] = plugin{Name: pluginPath, Path: pluginPath} json, _ := json.MarshalIndent(self.plugins, "", " ") - common.WriteFile(self.eth.DataDir+"/plugins.json", json) + ioutil.WriteFile(self.eth.DataDir+"/plugins.json", json, os.ModePerm) } func (self *Gui) RemovePlugin(pluginPath string) { delete(self.plugins, pluginPath) json, _ := json.MarshalIndent(self.plugins, "", " ") - common.WriteFile(self.eth.DataDir+"/plugins.json", json) + ioutil.WriteFile(self.eth.DataDir+"/plugins.json", json, os.ModePerm) } func (self *Gui) DumpState(hash, path string) { diff --git a/cmd/mist/gui.go b/cmd/mist/gui.go index 08f02f833..d37d6f81b 100644 --- a/cmd/mist/gui.go +++ b/cmd/mist/gui.go @@ -25,6 +25,7 @@ import "C" import ( "encoding/json" "fmt" + "io/ioutil" "math/big" "path" "runtime" @@ -91,8 +92,8 @@ func NewWindow(ethereum *eth.Ethereum) *Gui { plugins: make(map[string]plugin), serviceEvents: make(chan ServEv, 1), } - data, _ := common.ReadAllFile(path.Join(ethereum.DataDir, "plugins.json")) - json.Unmarshal([]byte(data), &gui.plugins) + data, _ := ioutil.ReadFile(path.Join(ethereum.DataDir, "plugins.json")) + json.Unmarshal(data, &gui.plugins) return gui } |