diff options
Diffstat (limited to 'src/cmd')
| -rw-r--r-- | src/cmd/asm/internal/lex/tokenizer.go | 4 | ||||
| -rw-r--r-- | src/cmd/compile/internal/noder/unified.go | 4 | ||||
| -rw-r--r-- | src/cmd/compile/internal/typecheck/iimport.go | 5 |
3 files changed, 6 insertions, 7 deletions
diff --git a/src/cmd/asm/internal/lex/tokenizer.go b/src/cmd/asm/internal/lex/tokenizer.go index 4db88e20c3..f60f7a11af 100644 --- a/src/cmd/asm/internal/lex/tokenizer.go +++ b/src/cmd/asm/internal/lex/tokenizer.go @@ -5,6 +5,7 @@ package lex import ( + "go/build/constraint" "io" "os" "strings" @@ -109,8 +110,7 @@ func (t *Tokenizer) Next() ScanToken { } text := s.TokenText() t.line += strings.Count(text, "\n") - // TODO: Use constraint.IsGoBuild once #44505 fixed. - if strings.HasPrefix(text, "//go:build") { + if constraint.IsGoBuild(text) { t.tok = BuildComment break } 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) |
