From 199289a58d801bad0f6049450a7eb4f3bad59282 Mon Sep 17 00:00:00 2001 From: mutantmonkey Date: Thu, 1 Oct 2015 22:33:30 -0700 Subject: [PATCH] change CreateTorrent to createTorrent After some discussion, I decided it was probably best to not export this after all. --- torrent.go | 4 ++-- torrent_test.go | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/torrent.go b/torrent.go index 5235c35..01176aa 100644 --- a/torrent.go +++ b/torrent.go @@ -37,7 +37,7 @@ func hashPiece(piece []byte) []byte { return h.Sum(nil) } -func CreateTorrent(fileName string, filePath string) ([]byte, error) { +func createTorrent(fileName string, filePath string) ([]byte, error) { chunk := make([]byte, TORRENT_PIECE_LENGTH) torrent := Torrent{ @@ -85,7 +85,7 @@ func fileTorrentHandler(c web.C, w http.ResponseWriter, r *http.Request) { return } - encoded, err := CreateTorrent(fileName, filePath) + encoded, err := createTorrent(fileName, filePath) if err != nil { oopsHandler(c, w, r) // 500 - creating torrent failed return diff --git a/torrent_test.go b/torrent_test.go index 5a1d34a..f0b2c8c 100644 --- a/torrent_test.go +++ b/torrent_test.go @@ -11,7 +11,7 @@ func TestCreateTorrent(t *testing.T) { fileName := "server.go" var decoded Torrent - encoded, err := CreateTorrent(fileName, fileName) + encoded, err := createTorrent(fileName, fileName) if err != nil { t.Fatal(err) } @@ -47,7 +47,7 @@ func TestCreateTorrent(t *testing.T) { func TestCreateTorrentWithImage(t *testing.T) { var decoded Torrent - encoded, err := CreateTorrent("test.jpg", "static/images/404.jpg") + encoded, err := createTorrent("test.jpg", "static/images/404.jpg") if err != nil { t.Fatal(err) }