mirror of https://github.com/grpc/grpc-go.git
parent
ed70822b12
commit
2773c7bbcf
|
@ -20,7 +20,7 @@ gRPC-Go requires Go 1.9 or later.
|
|||
|
||||
Constraints
|
||||
-----------
|
||||
The grpc package should only depend on standard Go packages and a small number of exceptions. If your contribution introduces new dependencies which are NOT in the [list](http://godoc.org/google.golang.org/grpc?imports), you need a discussion with gRPC-Go authors and consultants.
|
||||
The grpc package should only depend on standard Go packages and a small number of exceptions. If your contribution introduces new dependencies which are NOT in the [list](https://godoc.org/google.golang.org/grpc?imports), you need a discussion with gRPC-Go authors and consultants.
|
||||
|
||||
Documentation
|
||||
-------------
|
||||
|
|
|
@ -176,7 +176,7 @@ func toRadians(num float64) float64 {
|
|||
// The formula is based on http://mathforum.org/library/drmath/view/51879.html.
|
||||
func calcDistance(p1 *pb.Point, p2 *pb.Point) int32 {
|
||||
const CordFactor float64 = 1e7
|
||||
const R float64 = float64(6371000) // earth radius in metres
|
||||
const R = float64(6371000) // earth radius in metres
|
||||
lat1 := toRadians(float64(p1.Latitude) / CordFactor)
|
||||
lat2 := toRadians(float64(p2.Latitude) / CordFactor)
|
||||
lng1 := toRadians(float64(p1.Longitude) / CordFactor)
|
||||
|
|
|
@ -171,7 +171,7 @@ func (s *testServer) EmptyCall(ctx context.Context, in *testpb.Empty) (*testpb.E
|
|||
|
||||
func newPayload(t testpb.PayloadType, size int32) (*testpb.Payload, error) {
|
||||
if size < 0 {
|
||||
return nil, fmt.Errorf("Requested a response with invalid length %d", size)
|
||||
return nil, fmt.Errorf("requested a response with invalid length %d", size)
|
||||
}
|
||||
body := make([]byte, size)
|
||||
switch t {
|
||||
|
@ -179,7 +179,7 @@ func newPayload(t testpb.PayloadType, size int32) (*testpb.Payload, error) {
|
|||
case testpb.PayloadType_UNCOMPRESSABLE:
|
||||
return nil, fmt.Errorf("PayloadType UNCOMPRESSABLE is not supported")
|
||||
default:
|
||||
return nil, fmt.Errorf("Unsupported payload type: %d", t)
|
||||
return nil, fmt.Errorf("unsupported payload type: %d", t)
|
||||
}
|
||||
return &testpb.Payload{
|
||||
Type: t,
|
||||
|
|
|
@ -29,9 +29,9 @@ import (
|
|||
)
|
||||
|
||||
func (s) TestStreamCleanup(t *testing.T) {
|
||||
const initialWindowSize uint = 70 * 1024 // Must be higher than default 64K, ignored otherwise
|
||||
const bodySize uint = 2 * initialWindowSize // Something that is not going to fit in a single window
|
||||
const callRecvMsgSize uint = 1 // The maximum message size the client can receive
|
||||
const initialWindowSize uint = 70 * 1024 // Must be higher than default 64K, ignored otherwise
|
||||
const bodySize = 2 * initialWindowSize // Something that is not going to fit in a single window
|
||||
const callRecvMsgSize uint = 1 // The maximum message size the client can receive
|
||||
|
||||
ss := &stubServer{
|
||||
unaryCall: func(ctx context.Context, in *testpb.SimpleRequest) (*testpb.SimpleResponse, error) {
|
||||
|
|
Loading…
Reference in New Issue