diff --git a/07_errors/patrickmarabeas/main.go b/07_errors/patrickmarabeas/main.go index 790580777..a59669d40 100644 --- a/07_errors/patrickmarabeas/main.go +++ b/07_errors/patrickmarabeas/main.go @@ -1,5 +1,13 @@ package main -func main() { +import ( + "fmt" + "io" + "os" +) + +var out io.Writer = os.Stdout -} +func main() { + fmt.Fprint(out, "hello") +} \ No newline at end of file diff --git a/07_errors/patrickmarabeas/main_test.go b/07_errors/patrickmarabeas/main_test.go index c98b5b046..23ac60697 100644 --- a/07_errors/patrickmarabeas/main_test.go +++ b/07_errors/patrickmarabeas/main_test.go @@ -2,20 +2,16 @@ package main import ( "bytes" - "io" - "os" "testing" ) -var out io.Writer = os.Stdout - func TestMainOutput(t *testing.T) { var buf bytes.Buffer out = &buf main() - expected := "" + expected := "hello" got := buf.String()