Shrink main func to resolve gocyclo warning#207
Shrink main func to resolve gocyclo warning#207markmandel merged 1 commit intoagones-dev:masterfrom enocom:simple-main
Conversation
|
Build Succeeded 👏 Build Id: 1ba7c0f0-573d-464e-9900-4c25822fd1a9 The following development artifacts have been built, and will exist for the next 30 days:
|
|
Rebased onto master for a clean merge. |
|
Build Succeeded 👏 Build Id: 8cee3803-148b-4000-89ee-549b6e0e8279 The following development artifacts have been built, and will exist for the next 30 days:
|
markmandel
left a comment
There was a problem hiding this comment.
Approved! Just one question for my own curiosity,
|
|
||
| log.Print("Starting Health Ping") | ||
| stop := make(chan bool) | ||
| stop := make(chan struct{}) |
There was a problem hiding this comment.
Just for my own curiosity - why the change? Because it more closely matches context.Context and some of the Kubernetes constructs?
There was a problem hiding this comment.
Since stop is used purely as a signalling mechanism, and not as a way to transport meaningful information, I have followed the Go idiom of using struct{}, which indicates the value is of no meaning in and of itself. On the other hand, bool suggests we might send true or false, when in fact we don't really care about either.
There was a problem hiding this comment.
Thanks! That makes perfect sense!
|
Build Failed 😱 Build Id: 77855fb2-87ff-4b09-873d-05e7247d5690 Build Logs |
Fixes #178
This is the simplest fix to the gocyclo linter error: breaking out functions of related code. I propose taking the same approach for #177.