Skip to content
This repository was archived by the owner on Jun 27, 2023. It is now read-only.
This repository was archived by the owner on Jun 27, 2023. It is now read-only.

go:generate bug #515

@ahl5esoft

Description

@ahl5esoft
// i-subscriber.go
//go:generate mockgen -destination i-subscriber_mock.go -package pubsub my-go/plugin/pubsub ISubscriber

package pubsub

// Message is subscribe message
type Message struct {
	Channel string
	Text    string
}

// ISubscriber is subscriber interface
type ISubscriber interface {
	Subscribe(channels []string, message chan<- Message)
	Unsubscribe(channels ...string) error
}
// i-subscriber_mock.go
// Code generated by MockGen. DO NOT EDIT.
// Source: my-go/plugin/pubsub (interfaces: ISubscriber)

// Package pubsub is a generated GoMock package.
package pubsub

import (
	pubsub "my-go/plugin/pubsub"
	gomock "github.com/golang/mock/gomock"
	reflect "reflect"
)

// MockISubscriber is a mock of ISubscriber interface
type MockISubscriber struct {
	ctrl     *gomock.Controller
	recorder *MockISubscriberMockRecorder
}

// MockISubscriberMockRecorder is the mock recorder for MockISubscriber
type MockISubscriberMockRecorder struct {
	mock *MockISubscriber
}

// NewMockISubscriber creates a new mock instance
func NewMockISubscriber(ctrl *gomock.Controller) *MockISubscriber {
	mock := &MockISubscriber{ctrl: ctrl}
	mock.recorder = &MockISubscriberMockRecorder{mock}
	return mock
}

// EXPECT returns an object that allows the caller to indicate expected use
func (m *MockISubscriber) EXPECT() *MockISubscriberMockRecorder {
	return m.recorder
}

// Subscribe mocks base method
func (m *MockISubscriber) Subscribe(arg0 []string, arg1 chan<- pubsub.Message) {
	m.ctrl.T.Helper()
	m.ctrl.Call(m, "Subscribe", arg0, arg1)
}

// Subscribe indicates an expected call of Subscribe
func (mr *MockISubscriberMockRecorder) Subscribe(arg0, arg1 interface{}) *gomock.Call {
	mr.mock.ctrl.T.Helper()
	return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Subscribe", reflect.TypeOf((*MockISubscriber)(nil).Subscribe), arg0, arg1)
}

// Unsubscribe mocks base method
func (m *MockISubscriber) Unsubscribe(arg0 ...string) error {
	m.ctrl.T.Helper()
	varargs := []interface{}{}
	for _, a := range arg0 {
		varargs = append(varargs, a)
	}
	ret := m.ctrl.Call(m, "Unsubscribe", varargs...)
	ret0, _ := ret[0].(error)
	return ret0
}

// Unsubscribe indicates an expected call of Unsubscribe
func (mr *MockISubscriberMockRecorder) Unsubscribe(arg0 ...interface{}) *gomock.Call {
	mr.mock.ctrl.T.Helper()
	return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Unsubscribe", reflect.TypeOf((*MockISubscriber)(nil).Unsubscribe), arg0...)
}

the i-subscriber_mock.go's code contains references to the same package code pubsub "my-go/plugin/pubsub"

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions