diff --git a/Makefile b/Makefile index 6ec2e78e..206d9e0e 100644 --- a/Makefile +++ b/Makefile @@ -56,7 +56,6 @@ clean: ## Delete intermediate build artifacts test: build ## Run unit tests $(GO) test -race -cover ./... $(GO) test -tags protolegacy ./... - $(GO) test -tags purego ./... cd internal/benchmarks && SKIP_DOWNLOAD_GOOGLEAPIS=true $(GO) test -race -cover ./... .PHONY: benchmarks diff --git a/experimental/report/renderer_test.go b/experimental/report/renderer_test.go index 68e0a7c1..ec437230 100644 --- a/experimental/report/renderer_test.go +++ b/experimental/report/renderer_test.go @@ -12,10 +12,6 @@ // See the License for the specific language governing permissions and // limitations under the License. -// Protobuf-go no longer supports purego. This test depends on protobuf for -// decoding its inputs. Therefore, we disable it in purego mode. -//go:build !purego - package report_test import ( diff --git a/linker/pathkey_unsafe.go b/linker/pathkey.go similarity index 83% rename from linker/pathkey_unsafe.go rename to linker/pathkey.go index 66ecd20c..511e6f74 100644 --- a/linker/pathkey_unsafe.go +++ b/linker/pathkey.go @@ -12,12 +12,6 @@ // See the License for the specific language governing permissions and // limitations under the License. -//go:build !appengine && !gopherjs && !purego -// +build !appengine,!gopherjs,!purego - -// NB: other environments where unsafe is inappropriate should use "purego" build tag -// https://github.com/golang/go/issues/23172 - package linker import ( diff --git a/linker/pathkey_no_unsafe.go b/linker/pathkey_no_unsafe.go deleted file mode 100644 index e00debc6..00000000 --- a/linker/pathkey_no_unsafe.go +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright 2020-2024 Buf Technologies, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -//go:build appengine || gopherjs || purego -// +build appengine gopherjs purego - -// NB: other environments where unsafe is inappropriate should use "purego" build tag -// https://github.com/golang/go/issues/23172 - -package linker - -import ( - "reflect" - - "google.golang.org/protobuf/reflect/protoreflect" -) - -func pathKey(p protoreflect.SourcePath) interface{} { - rv := reflect.ValueOf(p) - arrayType := reflect.ArrayOf(rv.Len(), rv.Type().Elem()) - array := reflect.New(arrayType).Elem() - reflect.Copy(array, rv) - return array.Interface() -}