aboutsummaryrefslogtreecommitdiffhomepage
path: root/main_test.go
diff options
context:
space:
mode:
authorLars Lehtonen <[email protected]>2023-11-29 00:37:26 -0800
committerGitHub <[email protected]>2023-11-29 09:37:26 +0100
commit26a8ec207f0fe7b28c61829a3f254a29c40569c1 (patch)
treeb66e8abcf4e9a2f6a81384b602eceb674115628a /main_test.go
parent9ca889ba49cb7645a0bebacdd51a8229cdd46f8d (diff)
downloadhugo-26a8ec207f0fe7b28c61829a3f254a29c40569c1.tar.gz
hugo-26a8ec207f0fe7b28c61829a3f254a29c40569c1.zip
Fix handling of dropped error in test
Diffstat (limited to 'main_test.go')
-rw-r--r--main_test.go10
1 files changed, 6 insertions, 4 deletions
diff --git a/main_test.go b/main_test.go
index 2df40b0e2..4b6ad4caf 100644
--- a/main_test.go
+++ b/main_test.go
@@ -335,12 +335,14 @@ var commonTestScriptsParam = testscript.Params{
var info testInfo
// Read the .ready file's JSON into info.
f, err := os.Open(readyFilename)
- if err == nil {
- err = json.NewDecoder(f).Decode(&info)
- f.Close()
- } else {
+ if err != nil {
ts.Fatalf("failed to open .ready file: %v", err)
}
+ err = json.NewDecoder(f).Decode(&info)
+ if err != nil {
+ ts.Fatalf("error decoding json: %v", err)
+ }
+ f.Close()
for i, s := range info.BaseURLs {
ts.Setenv(fmt.Sprintf("HUGOTEST_BASEURL_%d", i), s)