mirror of
https://github.com/protocolbuffers/protobuf-go.git
synced 2024-12-29 12:17:48 +00:00
all: fix go generate (needs protolegacy build tag for weak fields)
Prior to this change, one could either use go generate or ./test.bash -regenerate to re-generate the files — but only the latter way would work. With this change, we make ./test.bash -regenerate call go generate so that the two ways cannot diverge again. Change-Id: I940df66ebc6a4200847cf751929b3611309b67bc Reviewed-on: https://go-review.googlesource.com/c/protobuf/+/547256 Reviewed-by: Lasse Folger <lassefolger@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
This commit is contained in:
parent
704136e0c0
commit
2b71f26c99
@ -367,8 +367,8 @@ func downloadArchive(check func(error), dstPath, srcURL, skipPrefix, wantSHA256
|
||||
func mustHandleFlags(t *testing.T) {
|
||||
if *regenerate {
|
||||
t.Run("Generate", func(t *testing.T) {
|
||||
fmt.Print(mustRunCommand(t, "go", "run", "-tags", "protolegacy", "./internal/cmd/generate-types", "-execute"))
|
||||
fmt.Print(mustRunCommand(t, "go", "run", "-tags", "protolegacy", "./internal/cmd/generate-protos", "-execute"))
|
||||
fmt.Print(mustRunCommand(t, "go", "generate", "./internal/cmd/generate-types"))
|
||||
fmt.Print(mustRunCommand(t, "go", "generate", "./internal/cmd/generate-protos"))
|
||||
files := strings.Split(strings.TrimSpace(mustRunCommand(t, "git", "ls-files", "*.go")), "\n")
|
||||
mustRunCommand(t, append([]string{"gofmt", "-w"}, files...)...)
|
||||
})
|
||||
|
@ -2,7 +2,7 @@
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
//go:generate go run . -execute
|
||||
//go:generate go run -tags protolegacy . -execute
|
||||
|
||||
package main
|
||||
|
||||
|
@ -2,7 +2,7 @@
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
//go:generate go run . -execute
|
||||
//go:generate go run -tags protolegacy . -execute
|
||||
|
||||
package main
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user