1
0
mirror of https://github.com/golang/go synced 2024-11-13 19:50:21 -07:00

fix windows build: always use / in filenames of go/doc test output

R=r
CC=golang-dev
https://golang.org/cl/5554055
This commit is contained in:
Robert Griesemer 2012-01-18 14:59:58 -08:00
parent 0203fbee64
commit eaf8295f3d

View File

@ -77,6 +77,11 @@ func Test(t *testing.T) {
importpath := dataDir + "/" + pkg.Name importpath := dataDir + "/" + pkg.Name
doc := New(pkg, importpath, 0) doc := New(pkg, importpath, 0)
// golden files always use / in filenames - canonicalize them
for i, filename := range doc.Filenames {
doc.Filenames[i] = filepath.ToSlash(filename)
}
// print documentation // print documentation
var buf bytes.Buffer var buf bytes.Buffer
if err := templateTxt.Execute(&buf, bundle{doc, fset}); err != nil { if err := templateTxt.Execute(&buf, bundle{doc, fset}); err != nil {