本文整理汇总了Golang中github.com/keybase/client/go/logger.TestLogBackend.Fatalf方法的典型用法代码示例。如果您正苦于以下问题:Golang TestLogBackend.Fatalf方法的具体用法?Golang TestLogBackend.Fatalf怎么用?Golang TestLogBackend.Fatalf使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类github.com/keybase/client/go/logger.TestLogBackend
的用法示例。
在下文中一共展示了TestLogBackend.Fatalf方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。
示例1: GetRootNodeOrBust
// GetRootNodeOrBust gets the root node for the given TLF name, which
// must be canonical, creating it if necessary, and failing if there's
// an error.
func GetRootNodeOrBust(
t logger.TestLogBackend, config Config, name string, public bool) Node {
n, err := GetRootNodeForTest(config, name, public)
if err != nil {
t.Fatalf("Couldn't get root node for %s (public=%t): %v",
name, public, err)
}
return n
}
示例2: parseTlfHandleOrBust
// parseTlfHandleOrBust parses the given TLF name, which must be
// canonical, into a TLF handle, and failing if there's an error.
func parseTlfHandleOrBust(t logger.TestLogBackend, config Config,
name string, public bool) *TlfHandle {
ctx := context.Background()
h, err := ParseTlfHandle(ctx, config.KBPKI(), name, public,
config.SharingBeforeSignupEnabled())
if err != nil {
t.Fatalf("Couldn't parse %s (public=%t) into a TLF handle: %v",
name, public, err)
}
return h
}
示例3: testRPCWithCanceledContext
func testRPCWithCanceledContext(t logger.TestLogBackend,
serverConn net.Conn, fn func(context.Context) error) {
ctx, cancel := context.WithCancel(context.Background())
go func() {
// Wait for RPC in fn to make progress.
n, err := serverConn.Read([]byte{1})
assert.Equal(t, n, 1)
assert.NoError(t, err)
cancel()
}()
err := fn(ctx)
if err != context.Canceled {
t.Fatalf("Function did not return a canceled error: %v", err)
}
}
示例4: SwitchDeviceForLocalUserOrBust
// SwitchDeviceForLocalUserOrBust switches the current user's current device
func SwitchDeviceForLocalUserOrBust(t logger.TestLogBackend, config Config, index int) {
name, uid, err := config.KBPKI().GetCurrentUserInfo(context.Background())
if err != nil {
t.Fatalf("Couldn't get UID: %v", err)
}
kbd, ok := config.KeybaseDaemon().(*KeybaseDaemonLocal)
if !ok {
t.Fatal("Bad keybase daemon")
}
if err := kbd.switchDeviceForTesting(uid, index); err != nil {
t.Fatal(err.Error())
}
if _, ok := config.Crypto().(*CryptoLocal); !ok {
t.Fatal("Bad crypto")
}
keySalt := keySaltForUserDevice(name, index)
signingKey := MakeLocalUserSigningKeyOrBust(keySalt)
cryptPrivateKey := MakeLocalUserCryptPrivateKeyOrBust(keySalt)
config.SetCrypto(NewCryptoLocal(config, signingKey, cryptPrivateKey))
}