import "github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-grpc-gateway" is a program, not an importable packagego list package _ ("github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-grpc-gateway")
This way is not allowed in version 1.21. Just delete this file and install the go binaries:
$ go install \ github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-grpc-gateway \ github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2 \ google.golang.org/protobuf/cmd/protoc-gen-go \ google.golang.org/grpc/cmd/protoc-gen-go-grpc