From 9e5ba6cea7ea05e7c3a8f361dd485b384d77eaf5 Mon Sep 17 00:00:00 2001 From: Stephen J Day Date: Wed, 10 May 2017 08:34:16 -0700 Subject: [PATCH] pkg/ioutils: remove unused functions Signed-off-by: Stephen J Day Upstream-commit: c546894aefbd661adc73ba3cf952d38f94627924 Component: engine --- components/engine/pkg/ioutils/fmt.go | 22 ---------------------- components/engine/pkg/ioutils/fmt_test.go | 17 ----------------- 2 files changed, 39 deletions(-) delete mode 100644 components/engine/pkg/ioutils/fmt.go delete mode 100644 components/engine/pkg/ioutils/fmt_test.go diff --git a/components/engine/pkg/ioutils/fmt.go b/components/engine/pkg/ioutils/fmt.go deleted file mode 100644 index 0b04b0ba3e..0000000000 --- a/components/engine/pkg/ioutils/fmt.go +++ /dev/null @@ -1,22 +0,0 @@ -package ioutils - -import ( - "fmt" - "io" -) - -// FprintfIfNotEmpty prints the string value if it's not empty -func FprintfIfNotEmpty(w io.Writer, format, value string) (int, error) { - if value != "" { - return fmt.Fprintf(w, format, value) - } - return 0, nil -} - -// FprintfIfTrue prints the boolean value if it's true -func FprintfIfTrue(w io.Writer, format string, ok bool) (int, error) { - if ok { - return fmt.Fprintf(w, format, ok) - } - return 0, nil -} diff --git a/components/engine/pkg/ioutils/fmt_test.go b/components/engine/pkg/ioutils/fmt_test.go deleted file mode 100644 index 8968863296..0000000000 --- a/components/engine/pkg/ioutils/fmt_test.go +++ /dev/null @@ -1,17 +0,0 @@ -package ioutils - -import "testing" - -func TestFprintfIfNotEmpty(t *testing.T) { - wc := NewWriteCounter(&NopWriter{}) - n, _ := FprintfIfNotEmpty(wc, "foo%s", "") - - if wc.Count != 0 || n != 0 { - t.Errorf("Wrong count: %v vs. %v vs. 0", wc.Count, n) - } - - n, _ = FprintfIfNotEmpty(wc, "foo%s", "bar") - if wc.Count != 6 || n != 6 { - t.Errorf("Wrong count: %v vs. %v vs. 6", wc.Count, n) - } -}