diff --git a/src/cmd/compile/internal/importer/iimport.go b/src/cmd/compile/internal/importer/iimport.go index 440f557a80d..82aff183354 100644 --- a/src/cmd/compile/internal/importer/iimport.go +++ b/src/cmd/compile/internal/importer/iimport.go @@ -233,10 +233,7 @@ func (p *iimporter) doDecl(pkg *types2.Package, name string) { } r := &importReader{p: p, currPkg: pkg} - // Reader.Reset is not available in Go 1.4. - // Use bytes.NewReader for now. - // r.declReader.Reset(p.declData[off:]) - r.declReader = *strings.NewReader(p.declData[off:]) + r.declReader.Reset(p.declData[off:]) r.obj(name) } @@ -282,10 +279,7 @@ func (p *iimporter) typAt(off uint64, base *types2.Named) types2.Type { } r := &importReader{p: p} - // Reader.Reset is not available in Go 1.4. - // Use bytes.NewReader for now. - // r.declReader.Reset(p.declData[off-predeclReserved:]) - r.declReader = *strings.NewReader(p.declData[off-predeclReserved:]) + r.declReader.Reset(p.declData[off-predeclReserved:]) t := r.doType(base) if canReuse(base, t) { diff --git a/src/cmd/compile/internal/typecheck/iimport.go b/src/cmd/compile/internal/typecheck/iimport.go index a08f62b4146..80ae0259e86 100644 --- a/src/cmd/compile/internal/typecheck/iimport.go +++ b/src/cmd/compile/internal/typecheck/iimport.go @@ -280,9 +280,7 @@ func (p *iimporter) newReader(off uint64, pkg *types.Pkg) *importReader { p: p, currPkg: pkg, } - // (*strings.Reader).Reset wasn't added until Go 1.7, and we - // need to build with Go 1.4. - r.Reader = *strings.NewReader(p.declData[off:]) + r.Reader.Reset(p.declData[off:]) return r }