From 91d5ce3def7c967b23de37546439bb4714e26e8a Mon Sep 17 00:00:00 2001 From: hopehook Date: Thu, 4 Aug 2022 10:12:20 +0800 Subject: all: clean up TODO after fixing issue 44505 For #44505 Change-Id: I89220be02372b5340cb987bf2ac870a9346a8c8f Reviewed-on: https://go-review.googlesource.com/c/go/+/421079 Run-TryBot: Matthew Dempsky TryBot-Result: Gopher Robot Reviewed-by: Matthew Dempsky Reviewed-by: Dmitri Shuralyov --- src/cmd/compile/internal/noder/unified.go | 4 ++-- src/cmd/compile/internal/typecheck/iimport.go | 5 ++--- 2 files changed, 4 insertions(+), 5 deletions(-) (limited to 'src/cmd/compile') diff --git a/src/cmd/compile/internal/noder/unified.go b/src/cmd/compile/internal/noder/unified.go index 1ded367383..922189f4d3 100644 --- a/src/cmd/compile/internal/noder/unified.go +++ b/src/cmd/compile/internal/noder/unified.go @@ -5,13 +5,13 @@ package noder import ( - "bytes" "fmt" "internal/goversion" "internal/pkgbits" "io" "runtime" "sort" + "strings" "cmd/compile/internal/base" "cmd/compile/internal/inline" @@ -180,7 +180,7 @@ func writePkgStub(noders []*noder) string { w.Flush() } - var sb bytes.Buffer // TODO(mdempsky): strings.Builder after #44505 is resolved + var sb strings.Builder pw.DumpTo(&sb) // At this point, we're done with types2. Make sure the package is diff --git a/src/cmd/compile/internal/typecheck/iimport.go b/src/cmd/compile/internal/typecheck/iimport.go index 96aaac6362..84c748f7f0 100644 --- a/src/cmd/compile/internal/typecheck/iimport.go +++ b/src/cmd/compile/internal/typecheck/iimport.go @@ -11,6 +11,7 @@ import ( "encoding/binary" "fmt" "go/constant" + "io" "math/big" "os" "strings" @@ -148,9 +149,7 @@ func ReadImports(pkg *types.Pkg, data string) { sLen := int64(ird.uint64()) dLen := int64(ird.uint64()) - // TODO(mdempsky): Replace os.SEEK_CUR with io.SeekCurrent after - // #44505 is fixed. - whence, _ := ird.Seek(0, os.SEEK_CUR) + whence, _ := ird.Seek(0, io.SeekCurrent) stringData := data[whence : whence+sLen] declData := data[whence+sLen : whence+sLen+dLen] ird.Seek(sLen+dLen, os.SEEK_CUR) -- cgit v1.3-6-g1900