]> Cypherpunks repositories - gostls13.git/commit
cmd/go: ignore UTF8 BOM when reading source code
authorunbyte <i@shangyes.net>
Tue, 15 Jun 2021 17:11:05 +0000 (17:11 +0000)
committerBryan C. Mills <bcmills@google.com>
Tue, 15 Jun 2021 18:42:11 +0000 (18:42 +0000)
commit219fe9d547d09d3de1b024c6c8b8314dd0bf12e4
treea2df411cf593dc3a165da112c6909417dd32f381
parent723f199edd8619c8eedc1c4e8df1e5f96599d51a
cmd/go: ignore UTF8 BOM when reading source code

Fix the problem that UTF8 BOM can cause the parsing of import path and directives to fail.

Fixes #46198
Fixes #46290
Fixes #35726

Change-Id: I2d9995ee82b094bcfa5583f0cb4e8547cb973077
GitHub-Last-Rev: 98abf91377f155266fa60505c0c12beccad38eeb
GitHub-Pull-Request: golang/go#46643
Reviewed-on: https://go-review.googlesource.com/c/go/+/325990
Reviewed-by: Bryan C. Mills <bcmills@google.com>
Trust: Bryan C. Mills <bcmills@google.com>
Trust: Robert Findley <rfindley@google.com>
Run-TryBot: Bryan C. Mills <bcmills@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
src/cmd/go/internal/imports/read.go
src/cmd/go/internal/imports/read_test.go
src/cmd/go/testdata/script/build_ignore_leading_bom.txt [new file with mode: 0644]
src/go/build/read.go
src/go/build/read_test.go