From b0596cd4ff0bca3b0b43a9f430d355e29f47acb3 Mon Sep 17 00:00:00 2001 From: Brian Tiger Chow Date: Fri, 16 Jan 2015 18:04:40 -0800 Subject: [PATCH] rename coreio to coreunix --- cmd/ipfs/init.go | 4 ++-- core/{io => coreunix}/add.go | 13 +------------ core/{io => coreunix}/cat.go | 13 +------------ test/epictest/addcat_test.go | 6 +++--- test/epictest/three_legged_cat_test.go | 6 +++--- 5 files changed, 10 insertions(+), 32 deletions(-) rename core/{io => coreunix}/add.go (71%) rename core/{io => coreunix}/cat.go (54%) diff --git a/cmd/ipfs/init.go b/cmd/ipfs/init.go index e652fd23a..0fe8fdaef 100644 --- a/cmd/ipfs/init.go +++ b/cmd/ipfs/init.go @@ -10,7 +10,7 @@ import ( cmds "github.com/jbenet/go-ipfs/commands" core "github.com/jbenet/go-ipfs/core" corecmds "github.com/jbenet/go-ipfs/core/commands" - core_io "github.com/jbenet/go-ipfs/core/io" + coreunix "github.com/jbenet/go-ipfs/core/coreunix" ci "github.com/jbenet/go-ipfs/p2p/crypto" peer "github.com/jbenet/go-ipfs/p2p/peer" repo "github.com/jbenet/go-ipfs/repo" @@ -130,7 +130,7 @@ func addTheWelcomeFile(repoRoot string) error { // Set up default file reader := bytes.NewBufferString(welcomeMsg) - k, err := core_io.Add(nd, reader) + k, err := coreunix.Add(nd, reader) if err != nil { return fmt.Errorf("failed to write test file: %s", err) } diff --git a/core/io/add.go b/core/coreunix/add.go similarity index 71% rename from core/io/add.go rename to core/coreunix/add.go index 50b8832fb..ade57652b 100644 --- a/core/io/add.go +++ b/core/coreunix/add.go @@ -1,15 +1,4 @@ -package core_io - -// TODO rename package to something that doesn't conflict with io/ioutil. -// Pretty names are hard to find. -// -// Candidates: -// -// go-ipfs/core/unix -// go-ipfs/core/io -// go-ipfs/core/ioutil -// go-ipfs/core/coreio -// go-ipfs/core/coreunix +package coreunix import ( "io" diff --git a/core/io/cat.go b/core/coreunix/cat.go similarity index 54% rename from core/io/cat.go rename to core/coreunix/cat.go index 0e0f2712a..8ba4d2917 100644 --- a/core/io/cat.go +++ b/core/coreunix/cat.go @@ -1,15 +1,4 @@ -package core_io - -// TODO rename package to something that doesn't conflict with io/ioutil. -// Pretty names are hard to find. -// -// Candidates: -// -// go-ipfs/core/unix -// go-ipfs/core/io -// go-ipfs/core/ioutil -// go-ipfs/core/coreio -// go-ipfs/core/coreunix +package coreunix import ( "io" diff --git a/test/epictest/addcat_test.go b/test/epictest/addcat_test.go index d3a99e932..b18c98644 100644 --- a/test/epictest/addcat_test.go +++ b/test/epictest/addcat_test.go @@ -12,7 +12,7 @@ import ( context "github.com/jbenet/go-ipfs/Godeps/_workspace/src/code.google.com/p/go.net/context" random "github.com/jbenet/go-ipfs/Godeps/_workspace/src/github.com/jbenet/go-random" "github.com/jbenet/go-ipfs/core" - core_io "github.com/jbenet/go-ipfs/core/io" + coreunix "github.com/jbenet/go-ipfs/core/coreunix" mocknet "github.com/jbenet/go-ipfs/p2p/net/mock" "github.com/jbenet/go-ipfs/p2p/peer" errors "github.com/jbenet/go-ipfs/util/debugerror" @@ -115,12 +115,12 @@ func DirectAddCat(data []byte, conf testutil.LatencyConfig) error { catter.Bootstrap(ctx, []peer.PeerInfo{adder.Peerstore.PeerInfo(adder.Identity)}) adder.Bootstrap(ctx, []peer.PeerInfo{catter.Peerstore.PeerInfo(catter.Identity)}) - keyAdded, err := core_io.Add(adder, bytes.NewReader(data)) + keyAdded, err := coreunix.Add(adder, bytes.NewReader(data)) if err != nil { return err } - readerCatted, err := core_io.Cat(catter, keyAdded) + readerCatted, err := coreunix.Cat(catter, keyAdded) if err != nil { return err } diff --git a/test/epictest/three_legged_cat_test.go b/test/epictest/three_legged_cat_test.go index b33b07077..2926abb7a 100644 --- a/test/epictest/three_legged_cat_test.go +++ b/test/epictest/three_legged_cat_test.go @@ -8,7 +8,7 @@ import ( context "github.com/jbenet/go-ipfs/Godeps/_workspace/src/code.google.com/p/go.net/context" core "github.com/jbenet/go-ipfs/core" - core_io "github.com/jbenet/go-ipfs/core/io" + coreunix "github.com/jbenet/go-ipfs/core/coreunix" mocknet "github.com/jbenet/go-ipfs/p2p/net/mock" "github.com/jbenet/go-ipfs/p2p/peer" errors "github.com/jbenet/go-ipfs/util/debugerror" @@ -62,12 +62,12 @@ func RunThreeLeggedCat(data []byte, conf testutil.LatencyConfig) error { adder.Bootstrap(ctx, []peer.PeerInfo{boostrapInfo}) catter.Bootstrap(ctx, []peer.PeerInfo{boostrapInfo}) - keyAdded, err := core_io.Add(adder, bytes.NewReader(data)) + keyAdded, err := coreunix.Add(adder, bytes.NewReader(data)) if err != nil { return err } - readerCatted, err := core_io.Cat(catter, keyAdded) + readerCatted, err := coreunix.Cat(catter, keyAdded) if err != nil { return err }