Change readFileContents method signature

Signed-off-by: Vartan Benohanian <vartanbeno@gmail.com>
This commit is contained in:
Vartan Benohanian
2020-07-21 21:56:32 -04:00
parent 390814b095
commit 977a222d66
9 changed files with 152 additions and 81 deletions
+5 -5
View File
@@ -49,19 +49,19 @@ func teardown() {
server.Close()
}
func readFileContents(t *testing.T, filepath string) string {
file, err := os.Open(filepath)
func readFileContents(path string) (string, error) {
file, err := os.Open(path)
if err != nil {
t.Fatalf("got unexpected error: %v", err)
return "", err
}
defer file.Close()
bytes, err := ioutil.ReadAll(file)
if err != nil {
t.Fatalf("got unexpected error: %v", err)
return "", err
}
return string(bytes)
return string(bytes), err
}
func testClientServices(t *testing.T, c *Client) {