Skip to content

Commit

Permalink
all: remove Go 1.17 build tags / workarounds
Browse files Browse the repository at this point in the history
related to golang/protobuf#1613

Change-Id: Ie4255c24c1b79b13aab763a75125836191088d26
Reviewed-on: https://go-review.googlesource.com/c/protobuf/+/585096
Reviewed-by: Lasse Folger <lassefolger@google.com>
Auto-Submit: Michael Stapelberg <stapelberg@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
  • Loading branch information
stapelberg authored and gopherbot committed May 13, 2024
1 parent f7dca67 commit 15d7b13
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 22 deletions.
4 changes: 0 additions & 4 deletions encoding/protojson/fuzz_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,6 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

// Go native fuzzing was added in go1.18. Remove this once we stop supporting
// go1.17.
//go:build go1.18

package protojson_test

import (
Expand Down
4 changes: 0 additions & 4 deletions encoding/prototext/fuzz_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,6 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

// Go native fuzzing was added in go1.18. Remove this once we stop supporting
// go1.17.
//go:build go1.18

package prototext_test

import (
Expand Down
13 changes: 3 additions & 10 deletions integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ import (
"os"
"os/exec"
"path/filepath"
"reflect"
"regexp"
"runtime"
"runtime/debug"
Expand Down Expand Up @@ -560,15 +559,9 @@ func race() bool {
if !ok {
return false
}
// Use reflect because the debug.BuildInfo.Settings field
// isn't available in Go 1.17.
s := reflect.ValueOf(bi).Elem().FieldByName("Settings")
if !s.IsValid() {
return false
}
for i := 0; i < s.Len(); i++ {
if s.Index(i).FieldByName("Key").String() == "-race" {
return s.Index(i).FieldByName("Value").String() == "true"
for _, setting := range bi.Settings {
if setting.Key == "-race" {
return setting.Value == "true"
}
}
return false
Expand Down
4 changes: 0 additions & 4 deletions proto/fuzz_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,6 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

// Go native fuzzing was added in go1.18. Remove this once we stop supporting
// go1.17.
//go:build go1.18

package proto_test

import (
Expand Down

0 comments on commit 15d7b13

Please sign in to comment.