diff --git a/autogold.go b/autogold.go index 7b7e354..79ffb8e 100644 --- a/autogold.go +++ b/autogold.go @@ -142,7 +142,7 @@ func ExpectFile(t *testing.T, got interface{}, opts ...Option) { t.Fatal(err) } } - if *failOnUpdate { + if *failOnUpdate || !*update { t.Log(fmt.Errorf("mismatch (-want +got):\n%s", colorDiff(diff))) t.FailNow() } diff --git a/expect.go b/expect.go index e2c9635..eca05cf 100644 --- a/expect.go +++ b/expect.go @@ -192,7 +192,7 @@ func Expect(want interface{}) Value { t.Fatal(err) } } - if *failOnUpdate { + if *failOnUpdate || !*update { writeProfile() t.Log(fmt.Errorf("mismatch (-want +got):\n%s", colorDiff(diff))) t.FailNow()