Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Go Language Go Language Overview Custom Types Structs

Arihant Banthia
Arihant Banthia
3,950 Points

Didn't understand the question

What is being asked to do in this question

src/clock/clock.go
package clock

type Clock struct {
  Hours int
  Minutes int
}

// DEFINE A "Noon" FUNCTION HERE
func Noon(t *Clock) Clock {
  r:=Clock{}
  r.Hours=12
  r.Minutes=0
  return r
}
Antoine Solomon
Antoine Solomon
2,850 Points

Do you need that argument to the Noon function? After all you are initializing the r variable to a new instance of Clock and eventually returning r

1 Answer

Bas Kuunk
Bas Kuunk
21,308 Points

The function should just return a Clock instance, which you do correctly, but it should not take any input. They ask for a regular function in the package, not a method on the type.

Remove the inputs and replace the body of the function as per the following:

func Noon() Clock {
  return Clock{12, 0}
}