utils

package
v0.3.0-4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 20, 2018 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Connect

func Connect(address string) (*grpc.ClientConn, error)

Connect address by grpc

Types

type SafeGoroutineTester

type SafeGoroutineTester struct{}

SafeGoroutineTester is an implementation of the mock ... interface which can be used to use the mock functions in another go routine.

The major issue is that the golang mock framework uses t.Fatalf() which causes a deadlock when called in another goroutine. To avoid this issue, this simple implementation prints the error then panics, which avoids the deadlock.

func (*SafeGoroutineTester) Errorf

func (s *SafeGoroutineTester) Errorf(format string, args ...interface{})

Errorf prints the error to the screen then panics

func (*SafeGoroutineTester) Fatalf

func (s *SafeGoroutineTester) Fatalf(format string, args ...interface{})

Fatalf prints the error to the screen then panics

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL