mirror of
https://github.com/gohugoio/hugo.git
synced 2024-11-07 20:30:36 -05:00
Fix handling of dropped error in test
This commit is contained in:
parent
9ca889ba49
commit
26a8ec207f
1 changed files with 6 additions and 4 deletions
10
main_test.go
10
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)
|
||||
|
|
Loading…
Reference in a new issue