-
-
Notifications
You must be signed in to change notification settings - Fork 128
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix issue with custom types shadowing basic types (#163)
When a custom type has a name that can shadow an in-built type, append MoqParam to the name. Example: var name stringMoqParam for null.String.
- Loading branch information
Showing
5 changed files
with
1,038 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
package shadowtypes | ||
|
||
import ( | ||
"github.com/matryer/moq/pkg/moq/testpackages/shadowtypes/types" | ||
) | ||
|
||
type ShadowTypes interface { | ||
ShadowString(string, types.String) | ||
|
||
ShadowInt(int, types.Int) | ||
ShadowInt8(int8, types.Int8) | ||
ShadowInt16(int16, types.Int16) | ||
ShadowInt32(int32, types.Int32) | ||
ShadowInt64(int64, types.Int64) | ||
|
||
ShadowUint(uint, types.Uint) | ||
ShadowUint8(uint8, types.Uint8) | ||
ShadowUint16(uint16, types.Uint16) | ||
ShadowUint32(uint32, types.Uint32) | ||
ShadowUint64(uint64, types.Uint64) | ||
|
||
ShadowFloat32(float32, types.Float32) | ||
ShadowFloat64(float64, types.Float64) | ||
|
||
ShadowByte(byte, types.Byte) | ||
|
||
ShadowRune(rune, types.Rune) | ||
|
||
ShadowBool(bool, types.Bool) | ||
|
||
ShadowComplex64(complex64, types.Complex64) | ||
ShadowComplex128(complex128, types.Complex128) | ||
|
||
ShadowUintptr(uintptr, types.Uintptr) | ||
} |
Oops, something went wrong.