@cryptotaxi247 / kubo / commits / fe3a4c177

remove some dead code

License: MIT Signed-off-by: Jeromy <jeromyj@gmail.com>

Jeromy committed Jul 16, 2017 at 02:27 UTC fe3a4c17729e215659e6e25346497eb36dcd8e44
1 file changed -28
core/commands/dag/dag.go
-28
@@ -3,7 +3,6 @@ package dagcmd
3 import (
4 "fmt"
5 "io"
6 - "io/ioutil"
6 "strings"
7
8 cmds "github.com/ipfs/go-ipfs/commands"
@@ -12,8 +11,6 @@ import (
11 pin "github.com/ipfs/go-ipfs/pin"
12
13 cid "gx/ipfs/QmTprEaAA2A9bst5XH7exuyi5KzNMK3SEDNN8rBDnKWcUS/go-cid"
15 - node "gx/ipfs/QmYNyRZJBUYPNrLszFmrBrPJbsBh2vMsefz5gnDpB5M1P6/go-ipld-format"
16 - ipldcbor "gx/ipfs/QmemYymP73eVdTUUMZEiSpiHeZQKNJdT5dP2iuHssZh1sR/go-ipld-cbor"
14 )
15
16 var DagCmd = &cmds.Command{
@@ -166,28 +163,3 @@ var DagGetCmd = &cmds.Command{
163 res.SetOutput(out)
164 },
165 }
169 -
170 -func convertJsonToType(r io.Reader, format string) (node.Node, error) {
171 - switch format {
172 - case "cbor", "dag-cbor":
173 - return ipldcbor.FromJson(r)
174 - case "dag-pb", "protobuf":
175 - return nil, fmt.Errorf("protobuf handling in 'dag' command not yet implemented")
176 - default:
177 - return nil, fmt.Errorf("unknown target format: %s", format)
178 - }
179 -}
180 -
181 -func convertRawToType(r io.Reader, format string) (node.Node, error) {
182 - switch format {
183 - case "cbor", "dag-cbor":
184 - data, err := ioutil.ReadAll(r)
185 - if err != nil {
186 - return nil, err
187 - }
188 -
189 - return ipldcbor.Decode(data)
190 - default:
191 - return nil, fmt.Errorf("unsupported target format for raw input: %s", format)
192 - }
193 -}