mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-10-30 16:32:26 -05:00
linting, fmt
This commit is contained in:
parent
2ed1e36ee0
commit
dda2c9ab1c
4 changed files with 11 additions and 11 deletions
|
|
@ -37,7 +37,6 @@ import (
|
|||
"github.com/superseriousbusiness/gotosocial/internal/transport"
|
||||
)
|
||||
|
||||
|
||||
/*
|
||||
publicKeyer is BORROWED DIRECTLY FROM https://github.com/go-fed/apcore/blob/master/ap/util.go
|
||||
Thank you @cj@mastodon.technology ! <3
|
||||
|
|
@ -50,8 +49,8 @@ type publicKeyer interface {
|
|||
getPublicKeyFromResponse is BORROWED DIRECTLY FROM https://github.com/go-fed/apcore/blob/master/ap/util.go
|
||||
Thank you @cj@mastodon.technology ! <3
|
||||
*/
|
||||
func getPublicKeyFromResponse(c context.Context, b []byte, keyId *url.URL) (p crypto.PublicKey, err error) {
|
||||
m := make(map[string]interface{}, 0)
|
||||
func getPublicKeyFromResponse(c context.Context, b []byte, keyID *url.URL) (p crypto.PublicKey, err error) {
|
||||
m := make(map[string]interface{})
|
||||
err = json.Unmarshal(b, &m)
|
||||
if err != nil {
|
||||
return
|
||||
|
|
@ -77,19 +76,19 @@ func getPublicKeyFromResponse(c context.Context, b []byte, keyId *url.URL) (p cr
|
|||
continue
|
||||
}
|
||||
pkValue := pkpIter.Get()
|
||||
var pkId *url.URL
|
||||
pkId, err = pub.GetId(pkValue)
|
||||
var pkID *url.URL
|
||||
pkID, err = pub.GetId(pkValue)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
if pkId.String() != keyId.String() {
|
||||
if pkID.String() != keyID.String() {
|
||||
continue
|
||||
}
|
||||
pkpFound = pkValue
|
||||
break
|
||||
}
|
||||
if pkpFound == nil {
|
||||
err = fmt.Errorf("cannot find publicKey with id: %s", keyId)
|
||||
err = fmt.Errorf("cannot find publicKey with id: %s", keyID)
|
||||
return
|
||||
}
|
||||
pkPemProp := pkpFound.GetW3IDSecurityV1PublicKeyPem()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue