Hello, I am beginner and I’d like to know if it’s ok to have returns(or any expression or statement) like this: return adjust(Clock{c.hour, c.minute + minutes})
Would it be better, if I just adjust the Clock and then return it?
return c```
Or even:
```c := Clock{c.hour, c.minute + minutes})
c = adjust(c Clock)
return c```
I assume it's up to me. This example is easy to read, but sometimes it could get really messy. So, is there any recommendation about how much it should be shrank? Or what is your opinion about how much is too much. Thanks.
It is indeed up to you. Most Go code is however written to favour explicitness and clarity rather than brevity. In your example, I’d probably have used the first and most brief way as it’s still entirely clear. The equation changes if the struct is larger or the function call important to point out or expensive.
Thank you very much, good reason to make a new iteration in Exercism. But it was just (maybe not good) example of writing this composite statements in general.