mirror of
https://github.com/protocolbuffers/protobuf-go.git
synced 2025-01-01 11:58:21 +00:00
a95b29fbf6
Rename each generated protobuf package such that the base of the Go package path is always equal to the Go package name to follow proper Go package naming conventions. The Go package name is derived from the .proto source file name by replacing ".proto" with "pb" and stripping all underscores. Change-Id: Iea05d1b5d94b1b2821ae10276ab771bb2df93c0e Reviewed-on: https://go-review.googlesource.com/c/protobuf/+/177380 Reviewed-by: Damien Neil <dneil@google.com>
25 lines
536 B
Go
25 lines
536 B
Go
// Copyright 2019 The Go Authors. All rights reserved.
|
|
// Use of this source code is governed by a BSD-style
|
|
// license that can be found in the LICENSE file.
|
|
|
|
package protojson_test
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"google.golang.org/protobuf/encoding/protojson"
|
|
|
|
"google.golang.org/protobuf/types/known/durationpb"
|
|
)
|
|
|
|
func BenchmarkUnmarshal_Duration(b *testing.B) {
|
|
input := []byte(`"-123456789.123456789s"`)
|
|
|
|
for i := 0; i < b.N; i++ {
|
|
err := protojson.Unmarshal(input, &durationpb.Duration{})
|
|
if err != nil {
|
|
b.Fatal(err)
|
|
}
|
|
}
|
|
}
|