percolate / charlatan

Go Interface Mocking Tool

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Variable names conflicts it generated mocks

8tomat8 opened this issue · comments

What did you do?

type Type struct{}

//go:generate charlatan -output ./mockTypesDAL.go TypesDAL
type TypesDAL interface {
	Get(id uint64) (t *Type, err error)
}

What did you expect to see?

Expected generated valid go code or some error

What did you see instead?

Generated functions "NewFake*" with name conflicts.
I think it because of the first letter of struct name.

System details

Package version v1.0.4 ( 4cd615c )

go version go1.10.1 linux/amd64
GOARCH="amd64"
GOBIN=""
GOCACHE="/home/tomat/.cache/go-build"
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/home/tomat/Projects/go"
GORACE=""
GOROOT="/usr/lib/go"
GOTMPDIR=""
GOTOOLDIR="/usr/lib/go/pkg/tool/linux_amd64"
GCCGO="gccgo"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build652025093=/tmp/go-build -gno-record-gcc-switches"
GOROOT/bin/go version: go version go1.10.1 linux/amd64
GOROOT/bin/go tool compile -V: compile version go1.10.1
uname -sr: Linux 4.14.34-1-MANJARO
LSB Version:	n/a
Distributor ID:	ManjaroLinux
Description:	Manjaro Linux
Release:	17.1.8
Codename:	Hakoila
/usr/lib/libc.so.6: GNU C Library (GNU libc) stable release version 2.26, by Roland McGrath et al.

@8tomat8 you should be all set with the latest version

@kevinbirch Thanks. Now it works well =)