var update … func TestRegress(t *testing.T) { … } func TestUpdateExample(t *testing.T) { … } // replace substitutes the definition text from new into the content of file. // The text in new is of the form // // var whatever = T{ // ... // } // // Replace searches file for an exact match for the text of the first line, // finds the closing brace, and then substitutes new for what used to be in the file. // This lets us update the regressGolden table during go test -update. func replace(t *testing.T, file string, new []byte) { … } var regressGolden …