From 6f5f3d6407bac4a110896eaea8071ad3f4ec02f7 Mon Sep 17 00:00:00 2001 From: Ian Adam Naval Date: Thu, 16 Oct 2014 19:02:02 -0400 Subject: [PATCH] Fix creating filesystem structure --- filesystem.go | 2 +- filesystem_test.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/filesystem.go b/filesystem.go index 728827a..2355d6f 100644 --- a/filesystem.go +++ b/filesystem.go @@ -27,7 +27,7 @@ func NewFilesystem(args []string) (procPtr *Filesystem, err error) { // TODO: add error checking size, _ := strconv.Atoi(args[1]) used, _ := strconv.Atoi(args[2]) - available, _ := strconv.Atoi(args[2]) + available, _ := strconv.Atoi(args[3]) procPtr = &Filesystem{ args[0], size, used, available, args[4]} } diff --git a/filesystem_test.go b/filesystem_test.go index dfa7ecb..60f5093 100644 --- a/filesystem_test.go +++ b/filesystem_test.go @@ -20,7 +20,7 @@ func TestNewFilesystem(t *testing.T) { if err != nil { t.Errorf("Passing 5 strings should not raise an error") } - expected := Filesystem{"1", "2", "3", "4", "5"} + expected := Filesystem{"1", 2, 3, 4, "5"} actual := *proc if expected != actual { t.Errorf("Filesystem was incorrectly generated:\n%s != %s", expected, actual)