mirror of
https://salsa.debian.org/mdosch/go-sendxmpp
synced 2024-11-17 03:25:33 +00:00
[golangci-lint]: Use constant for result.
This commit is contained in:
parent
d85cf8fee7
commit
a0b6c045c7
1
const.go
1
const.go
@ -23,4 +23,5 @@ const (
|
|||||||
strChat = "chat"
|
strChat = "chat"
|
||||||
strError = "error"
|
strError = "error"
|
||||||
strGroupchat = "groupchat"
|
strGroupchat = "groupchat"
|
||||||
|
strResult = "result"
|
||||||
)
|
)
|
||||||
|
@ -85,7 +85,7 @@ func httpUpload(client *xmpp.Client, iqc chan xmpp.IQ,
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
log.Fatal(err)
|
log.Fatal(err)
|
||||||
}
|
}
|
||||||
if iqDiscoInfo.Type != "result" {
|
if iqDiscoInfo.Type != strResult {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
iqDiscoInfoXML := etree.NewDocument()
|
iqDiscoInfoXML := etree.NewDocument()
|
||||||
@ -170,7 +170,7 @@ func httpUpload(client *xmpp.Client, iqc chan xmpp.IQ,
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
log.Fatal(err)
|
log.Fatal(err)
|
||||||
}
|
}
|
||||||
if uploadSlot.Type != "result" {
|
if uploadSlot.Type != strResult {
|
||||||
log.Fatal("error while requesting upload slot.")
|
log.Fatal("error while requesting upload slot.")
|
||||||
}
|
}
|
||||||
iqHTTPUploadSlotXML := etree.NewDocument()
|
iqHTTPUploadSlotXML := etree.NewDocument()
|
||||||
|
8
ox.go
8
ox.go
@ -265,7 +265,7 @@ func oxPublishPubKey(jid string, client *xmpp.Client, iqc chan xmpp.IQ,
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
if iqReply.Type != "result" {
|
if iqReply.Type != strResult {
|
||||||
return errors.New("error while publishing public key")
|
return errors.New("error while publishing public key")
|
||||||
}
|
}
|
||||||
ownPubKeyRingFromPubsub, err := oxRecvPublicKeys(client, iqc, jid, fingerprint)
|
ownPubKeyRingFromPubsub, err := oxRecvPublicKeys(client, iqc, jid, fingerprint)
|
||||||
@ -313,7 +313,7 @@ func oxPublishPubKey(jid string, client *xmpp.Client, iqc chan xmpp.IQ,
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
if iqReply.Type != "result" {
|
if iqReply.Type != strResult {
|
||||||
return errors.New("couldn't publish public key list")
|
return errors.New("couldn't publish public key list")
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
@ -499,7 +499,7 @@ func oxRecvPublicKeys(client *xmpp.Client, iqc chan xmpp.IQ, recipient string,
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
if oxPublicKey.Type != "result" {
|
if oxPublicKey.Type != strResult {
|
||||||
return nil, errors.New("error while requesting public key for " +
|
return nil, errors.New("error while requesting public key for " +
|
||||||
recipient)
|
recipient)
|
||||||
}
|
}
|
||||||
@ -574,7 +574,7 @@ func oxGetPublicKeyRing(client *xmpp.Client, iqc chan xmpp.IQ,
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
log.Fatal(err)
|
log.Fatal(err)
|
||||||
}
|
}
|
||||||
if oxPublicKeyList.Type != "result" {
|
if oxPublicKeyList.Type != strResult {
|
||||||
return nil, errors.New("error while requesting public openpgp keys for " +
|
return nil, errors.New("error while requesting public openpgp keys for " +
|
||||||
recipient)
|
recipient)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user