Cleanup content-type protobuf constants

This commit is contained in:
wojtekt
2019-04-19 14:34:01 +02:00
parent c1d2735178
commit b48cc43eff
6 changed files with 27 additions and 31 deletions

View File

@@ -121,7 +121,7 @@ func TestProtobufRoundTrip(t *testing.T) {
func BenchmarkEncodeCodecProtobuf(b *testing.B) {
items := benchmarkItems(b)
width := len(items)
s := protobuf.NewSerializer(nil, nil, "application/arbitrary.content.type")
s := protobuf.NewSerializer(nil, nil)
b.ResetTimer()
for i := 0; i < b.N; i++ {
if _, err := runtime.Encode(s, &items[i%width]); err != nil {
@@ -142,7 +142,7 @@ func BenchmarkEncodeCodecFromInternalProtobuf(b *testing.B) {
b.Fatal(err)
}
}
s := protobuf.NewSerializer(nil, nil, "application/arbitrary.content.type")
s := protobuf.NewSerializer(nil, nil)
codec := legacyscheme.Codecs.EncoderForVersion(s, v1.SchemeGroupVersion)
b.ResetTimer()
for i := 0; i < b.N; i++ {
@@ -170,7 +170,7 @@ func BenchmarkEncodeProtobufGeneratedMarshal(b *testing.B) {
func BenchmarkDecodeCodecToInternalProtobuf(b *testing.B) {
items := benchmarkItems(b)
width := len(items)
s := protobuf.NewSerializer(legacyscheme.Scheme, legacyscheme.Scheme, "application/arbitrary.content.type")
s := protobuf.NewSerializer(legacyscheme.Scheme, legacyscheme.Scheme)
encoder := legacyscheme.Codecs.EncoderForVersion(s, v1.SchemeGroupVersion)
var encoded [][]byte
for i := range items {