alias

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: Apr 7, 2025 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Barer

type Barer interface {
	Bar(FooerAlias) FooerAlias
}

Case 3: Generate mock for an interface that takes in alias parameters

and returns alias results.

type BarerAlias

type BarerAlias = Barer

Case 4: Combination of cases 2 & 3.

type Bazer

type Bazer interface {
	Baz(Fooer) Fooer
}

Case 5: Generate mock for an interface that actually returns

the underlying type. This will generate mocks that use the alias,
but that should be fine since they should be interchangeable.

type Fooer

type Fooer interface {
	Foo()
}

Case 1: A interface that has alias references in this package

should still be generated for its underlying name, i.e., MockFooer,
even though we have the alias replacement logic.

type FooerAlias

type FooerAlias = Fooer

Case 2: Generating a mock for an alias type.

type QuuxerConsumer

type QuuxerConsumer interface {
	Consume(subpkg.Quuxer) subpkg.Quuxer
}

Case 7: Generate mock for a type that refers to an alias defined in another package

for an unexported type in that other package.
The generated method should only use the alias, not the unexported underlying name.

type QuxerAlias

type QuxerAlias = subpkg.Quxer

Case 6: Generate mock for a type that refers to an alias defined in this package

for a type from another package.
The generated methods should use the alias defined here.

type QuxerConsumer

type QuxerConsumer interface {
	Consume(QuxerAlias) QuxerAlias
}

Directories

Path Synopsis
Package mock is a generated GoMock package.
Package mock is a generated GoMock package.

Jump to

Keyboard shortcuts

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