Define type in Meetup exercice

In the Meetup exercise, we must define the WeekSchedule type.
I suppose that i can make something like that:

type WeekSchedule int

const (
First WeekSchedule = iota
Second
Third
Fourth
Last
Teenth
)

and then detect if wSched is egal to the constant First or Second etc…

Or something like that:

type WeekSchedule string

and then detect if wSched is egal to the string "first" or "second" etc…

But when i look to the cases_test.go, the entrance was strings like "teenth Wednesday of May 2020", "Teenth", "First" etc…

So there is no choice for WeekSchedule type, it must be string, right?

Why the WeekSchedule type is not describe in the instructions (a priori we can’t guess it)

Hi @Humfred, welcome to Exercism!

In general practise exercises follow a “Test first” approach, where the tests are the source of truth. Instructions in natural language cannot be precise in all aspects required for implementations. Tests are instructions in the most precise language you can get - your programming language.

Also the test data and the instructions are “cross language”, and so need to be free of types or other implementation details. For this exercise the test data contains the weekdays as strings. You may choose to translate it to an int for your implementation first, or use it as is for other types of implementations. It’s your choice. Feel free to use your approach to the problem, and translate inputs / outputs as required by the tests.

Thank you for your answer, I understand why you should not write type in the instructions.

However, I still don’t understand how tests work: I finished the exercise by choosing this type for WeekSchedule:

type WeekSchedule int

const (
	First WeekSchedule = iota
	Second
	Third
	Fourth
	Last
	Teenth
)

and it works.
So I’ve got a function (Day()) that asks for WeekSchedule to be an int when in the file cases_test.go WeekSchedule is a string: that should give an incompatibility error for WeekSchedule , shouldn’t it?

Where do you see that? The tests imports and uses the constant you defined.

ho, I confused myself: I created these constants because I thought it was logical and I was convinced that what the test expected was a string.
In fact, I asked myself far too many questions.
Thanks for taking the time to answer.