From fa593f7c9f153f6ba804aa935b8f6dc72b6d9709 Mon Sep 17 00:00:00 2001 From: Dimitri Sokolyuk Date: Wed, 13 Jul 2016 12:34:58 +0200 Subject: Rename Open into New --- cmd/btcheck/main.go | 2 +- cmd/btshow/main.go | 2 +- meta/torrent.go | 2 +- meta/torrent_test.go | 6 +++--- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/cmd/btcheck/main.go b/cmd/btcheck/main.go index a48123f..ad80081 100644 --- a/cmd/btcheck/main.go +++ b/cmd/btcheck/main.go @@ -12,7 +12,7 @@ func main() { if len(os.Args) != 2 { log.Fatal("usage: ", os.Args[0], " ") } - tor, err := meta.Open(os.Args[1]) + tor, err := meta.New(os.Args[1]) if err != nil { log.Fatal(err) } diff --git a/cmd/btshow/main.go b/cmd/btshow/main.go index cf27ead..669e463 100644 --- a/cmd/btshow/main.go +++ b/cmd/btshow/main.go @@ -12,7 +12,7 @@ func main() { if len(os.Args) != 2 { log.Fatal("usage: ", os.Args[0], " ") } - tor, err := meta.Open(os.Args[1]) + tor, err := meta.New(os.Args[1]) if err != nil { log.Fatal(err) } diff --git a/meta/torrent.go b/meta/torrent.go index 305a846..80c987b 100644 --- a/meta/torrent.go +++ b/meta/torrent.go @@ -35,7 +35,7 @@ func (t Torrent) String() string { return s } -func Open(fname string) (Torrent, error) { +func New(fname string) (Torrent, error) { var tor Torrent body, err := ioutil.ReadFile(fname) if err != nil { diff --git a/meta/torrent_test.go b/meta/torrent_test.go index c7c4ded..3dd8595 100644 --- a/meta/torrent_test.go +++ b/meta/torrent_test.go @@ -10,7 +10,7 @@ var tors = map[string]string{ } func TestPieces(t *testing.T) { - tor, err := Open("../examples/" + tors["mul"]) + tor, err := New("../examples/" + tors["mul"]) if err != nil { t.Error(err) } @@ -21,7 +21,7 @@ func TestPieces(t *testing.T) { } func TestPieces2(t *testing.T) { - tor, err := Open("../examples/" + tors["mul"]) + tor, err := New("../examples/" + tors["mul"]) if err != nil { t.Error(err) } @@ -32,7 +32,7 @@ func TestPieces2(t *testing.T) { func TestReadAt(t *testing.T) { t.Skip() - tor, err := Open("../examples/" + tors["bsd"]) + tor, err := New("../examples/" + tors["bsd"]) if err != nil { t.Error(err) } -- cgit v1.2.3