Merge pull request #8816 from gyuho/gofmt

lease/leasehttp: use keyed fields in composite literals
release-3.3
Gyu-Ho Lee 2017-11-03 10:11:12 -07:00 committed by GitHub
commit 41d37fcc51
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 1 deletions

View File

@ -191,7 +191,12 @@ func RenewHTTP(ctx context.Context, id lease.LeaseID, url string, rt http.RoundT
// TimeToLiveHTTP retrieves lease information of the given lease ID.
func TimeToLiveHTTP(ctx context.Context, id lease.LeaseID, keys bool, url string, rt http.RoundTripper) (*leasepb.LeaseInternalResponse, error) {
// will post lreq protobuf to leader
lreq, err := (&leasepb.LeaseInternalRequest{&pb.LeaseTimeToLiveRequest{ID: int64(id), Keys: keys}}).Marshal()
lreq, err := (&leasepb.LeaseInternalRequest{
LeaseTimeToLiveRequest: &pb.LeaseTimeToLiveRequest{
ID: int64(id),
Keys: keys,
},
}).Marshal()
if err != nil {
return nil, err
}