зеркало из https://github.com/golang/appengine.git
appengine: name returned parameters on SignBytes to improve documentation
Change-Id: I6dcb7e070a0c5f84772e5af2c593f4390eefeb7a
This commit is contained in:
Родитель
8c64777763
Коммит
bc32c3d353
|
@ -126,15 +126,14 @@ func ServiceAccount(c context.Context) (string, error) {
|
|||
}
|
||||
|
||||
// SignBytes signs bytes using a private key unique to your application.
|
||||
func SignBytes(c context.Context, bytes []byte) (string, []byte, error) {
|
||||
func SignBytes(c context.Context, bytes []byte) (keyName string, signature []byte, err error) {
|
||||
req := &pb.SignForAppRequest{BytesToSign: bytes}
|
||||
res := &pb.SignForAppResponse{}
|
||||
|
||||
err := internal.Call(c, "app_identity_service", "SignForApp", req, res)
|
||||
if err != nil {
|
||||
if err := internal.Call(c, "app_identity_service", "SignForApp", req, res); err != nil {
|
||||
return "", nil, err
|
||||
}
|
||||
return res.GetKeyName(), res.GetSignatureBytes(), err
|
||||
return res.GetKeyName(), res.GetSignatureBytes(), nil
|
||||
}
|
||||
|
||||
func init() {
|
||||
|
|
Загрузка…
Ссылка в новой задаче