cmd/racebuild: use multi-line match for README regexp

In https://golang.org/cl/115375 I had neglected to test against a
non-empty README file, and accidentally wrote a regexp that never
matches.

Change-Id: I676cb11abea7e0f5bf337aab640ebc2478295a9b
Reviewed-on: https://go-review.googlesource.com/115377
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
This commit is contained in:
Bryan C. Mills 2018-05-30 16:53:54 -04:00
Родитель 11ce5df82e
Коммит 01f5214fec
1 изменённых файлов: 1 добавлений и 1 удалений

Просмотреть файл

@ -392,7 +392,7 @@ func (p *Platform) UpdateReadme() error {
// record it in the README.
updatedLine := fmt.Sprintf(readmeTmpl, syso, *flagRev, goRev)
lineRE, err := regexp.Compile("^" + fmt.Sprintf(readmeTmpl, regexp.QuoteMeta(syso), commitRE, commitRE) + "$")
lineRE, err := regexp.Compile("(?m)^" + fmt.Sprintf(readmeTmpl, regexp.QuoteMeta(syso), commitRE, commitRE) + "$")
if err != nil {
return err
}