Automate Your Home Using Go: Chapter 2 Writing the Code suggestion

@mriley and @rgerardi

When describing the code for getdate they say

If this call fails, set the status boolean value to false. Otherwise, create a new string called dateresult and concatenate it into a sentence.

However this is not what the code does. There is not an else clause that create a new string if there is not an error. It is going to do that even if there is an error.

Further, the standard port for Control Center on MacOS is 5000. I would suggest changing the port used in the code to something different.

1 Like

@JacobTomaw Thank you for your feedback. You’re correct about the getdate error handling, and we will update the code.

We will also review the example port 5000.

Thank you again !
Ricardo