testx

package
v0.0.0-...-09c63dc Latest Latest
Warning

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

Go to latest
Published: Jun 8, 2022 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Overview

Author:ydy Date: Desc:

Package testx is a generated GoMock package.

Author:ydy Date: Desc:

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Add

func Add(a int, b int) int

Add 方法用于演示go test使用

func GetFromDB

func GetFromDB(db DB, key string) int

func MakeSliceWithPreAlloc

func MakeSliceWithPreAlloc() []int

MakeSliceWithPreAlloc 通过预分配Slice的存储空间构造

func MakeSliceWithoutAlloc

func MakeSliceWithoutAlloc() []int

MakeSliceWithPreAlloc 不预分配

Types

type DB

type DB interface {
	Get(key string) (int, error)
}

db.go

type MockDB

type MockDB struct {
	// contains filtered or unexported fields
}

MockDB is a mock of DB interface.

func NewMockDB

func NewMockDB(ctrl *gomock.Controller) *MockDB

NewMockDB creates a new mock instance.

func (*MockDB) EXPECT

func (m *MockDB) EXPECT() *MockDBMockRecorder

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockDB) Get

func (m *MockDB) Get(key string) (int, error)

Get mocks base method.

type MockDBMockRecorder

type MockDBMockRecorder struct {
	// contains filtered or unexported fields
}

MockDBMockRecorder is the mock recorder for MockDB.

func (*MockDBMockRecorder) Get

func (mr *MockDBMockRecorder) Get(key interface{}) *gomock.Call

Get indicates an expected call of Get.

Directories

Path Synopsis
internal
db

Jump to

Keyboard shortcuts

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