Insufficient error message regarding interfaces

Hey,

I started to play around with interfaces and got to a point where I have no idea what I’m actually doing wrong. Right now it would be enough for me if you have just a look at the error message that I get since it tells me what it wants is exactly what it gets! I don’t see any reason for an error. MessageContent is an interface and FieldMessage implements it.

.\MsgHandler_test.go:18: cannot use test (type "bitbucket.org/SirHeadless/TicTacToe/golang/msgInfo/messageContent".FieldMessage) as type "bitbucket.org/Sirheadless/TicTacToe/golang/msgInfo/messageContent".MessageContent in field value:
	"bitbucket.org/SirHeadless/TicTacToe/golang/msgInfo/messageContent".FieldMessage does not implement "bitbucket.org/Sirheadless/TicTacToe/golang/msgInfo/messageContent".MessageContent (missing "bitbucket.org/Sirheadless/TicTacToe/golang/msgInfo/messageContent".messageContent method)
		have "bitbucket.org/SirHeadless/TicTacToe/golang/msgInfo/messageContent".messageContent()
		want "bitbucket.org/Sirheadless/TicTacToe/golang/msgInfo/messageContent".messageContent()

Compare the casing of “sirheadless”. You have confusion in your code about what the actual import path is.

1 Like

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.