nelsam / hel

Hel rules over Helheim, where the souls unworthy of Valhalla reside. It's also a mock generator for Go.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Struct members have '_'

enocom opened this issue · comments

Struct fields are generated with an underscore to disambiguate from the receiver. This isn't necessary and fails to compile as the underscore is not included in field names when assigning to them in the mock implementations:

struct field definition:

SendMsgInput  struct {
	M_ chan interface{}
}

struct field use:

func (m *mockDopplerIngestor_PushServer) RecvMsg(m_ interface{}) error {
	m.RecvMsgCalled <- true
	m.RecvMsgInput.M <- m_
	return <-m.RecvMsgOutput.Ret0
}

/cc @jasonkeene

This should be resolved. If not, please reopen.

This has a bug. The Channel definition also gets a _ but it when the channel is written to it does not.

@apoydence Can you provide a failing test? This test has me doubting you. Are you sure you used the most recent version of hel?