Booking up for Beauty (Golang) - failing test doesn't show the culprit

Hello everyone,

I am trying to solve the Booking up for Beauty exercise (in Golang). The tests are failing but the error message doesn’t tell what is it failing on:
image

Can anybody hint me what is the culprit based on the error message ?
I know I can search find community solutions for this function but I don’t want to …

Have you looked at the test code to see what the test is doing?

It’s a Concept Exercise so you can’t see the tests in the editor

Probably not without seeing your code. If you share your code (use a codeblock please) someone will know and we can work out what the error message is trying to say. It looks like that error message could maybe do with some improvement, so I’ll CC @junedev and @andrerfcsantos.

This is the code I am using:

// HasPassed returns whether a date has passed.
func HasPassed(date string) bool {
    t, err := time.Parse("January 1, 2006 15:04:05", date)
    if err != nil {
		panic(err)
	}
	return time.Now().After(t)  
}

I think the month-day part there may have a mistake.

In my code or the test code ?

In your code

I can seek community solutions but my point is that based on the error from the tests I am not able to progress as I don’t know what data my code failes with.

The day-of-month needs to be “2” when using a Go time parse format layout.

The HasPadded test data is:

	tests := map[string]struct {
		in   string
		want bool
	}{
		"HasPassed 1": {in: "October 3, 2019 20:32:00", want: true},
		"HasPassed 2": {in: "January 28, 1974 2:02:02", want: true},
		"HasPassed 3": {in: "December 9, 2112 11:59:59", want: false},
	}

Thanks, that worked.
BTW - where do I find the source code for the tests ?

As iHiD mentioned, learning exercise tests are intentionally hidden, unlike practice exercises where the website shows you the tests directly in the editor.

If you work locally, the exercism download command should download the test files (for learning and practice exercises). You can also always look things up on GitHub, since Exercism is all open source. Go learning exercises can be seen here: https://github.com/exercism/go/tree/main/exercises/concept/