本文整理汇总了Golang中github.com/keybase/client/go/protocol.UID.NotEqual方法的典型用法代码示例。如果您正苦于以下问题:Golang UID.NotEqual方法的具体用法?Golang UID.NotEqual怎么用?Golang UID.NotEqual使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类github.com/keybase/client/go/protocol.UID
的用法示例。
在下文中一共展示了UID.NotEqual方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。
示例1: CheckUIDAgainstCasedUsername
// CheckUIDAgainstCasedUsername takes the input string, does not convert toLower,
// and then hashes it to recover a UID. This is a workaround for some
// users whose UIDs were computed incorrectly.
func CheckUIDAgainstCasedUsername(uid keybase1.UID, username string) (err error) {
u2 := UsernameToUIDPreserveCase(username)
if uid.NotEqual(u2) {
err = UIDMismatchError{fmt.Sprintf("%s != %s (via %s)", uid, u2, username)}
}
return
}
示例2: MatchUser
func (mul *MerkleUserLeaf) MatchUser(u *User, uid keybase1.UID, un string) (err error) {
if mul.username != u.GetName() {
err = MerkleClashError{fmt.Sprintf("vs loaded object: username %s != %s", mul.username, u.GetName())}
} else if mul.uid.NotEqual(u.GetUID()) {
err = MerkleClientError{fmt.Sprintf("vs loaded object: UID %s != %s", mul.uid, u.GetUID())}
} else if len(un) > 0 && mul.username != un {
err = MerkleClashError{fmt.Sprintf("vs given arg: username %s != %s", mul.username, un)}
} else if uid.NotEqual(mul.uid) {
err = MerkleClashError{fmt.Sprintf("vs given arg: UID %s != %s", uid, mul.uid)}
}
return
}
示例3: MatchUser
func (mul *MerkleUserLeaf) MatchUser(u *User, uid keybase1.UID, nun NormalizedUsername) (err error) {
if mul.username != u.GetName() {
err = MerkleClashError{fmt.Sprintf("vs loaded object: username %s != %s", mul.username, u.GetName())}
} else if mul.uid.NotEqual(u.GetUID()) {
err = MerkleClientError{fmt.Sprintf("vs loaded object: UID %s != %s", mul.uid, u.GetUID())}
} else if !nun.IsNil() && !NewNormalizedUsername(mul.username).Eq(nun) {
err = MerkleClashError{fmt.Sprintf("vs given arg: username %s != %s", mul.username, nun)}
} else if uid.NotEqual(mul.uid) {
err = MerkleClashError{fmt.Sprintf("vs given arg: UID %s != %s", uid, mul.uid)}
}
return
}
示例4: TrackChainLinkFor
func (idt *IdentityTable) TrackChainLinkFor(username string, uid keybase1.UID) (*TrackChainLink, error) {
list, found := idt.tracks[username]
if !found {
return nil, nil
}
for i := len(list) - 1; i >= 0; i-- {
link := list[i]
if link.IsRevoked() {
// noop; continue on!
continue
}
uid2, err := link.GetTrackedUID()
if err != nil {
return nil, fmt.Errorf("Bad tracking statement for %s: %s", username, err)
}
if uid.NotEqual(uid2) {
return nil, fmt.Errorf("Bad UID in tracking statement for %s: %s != %s", username, uid, uid2)
}
return link, nil
}
return nil, nil
}