mactsouk / mGo4th

Source code for Mastering Go, 4th edition.
MIT License
38 stars 25 forks source link

randomNumbers.go code repetition #3

Closed rgerardi closed 11 months ago

rgerardi commented 11 months ago

I like the example on randomNumbers.go but there's a lot of code repetition that makes the example not so clear. Perhaps there's a better way to process the arguments.

mactsouk commented 11 months ago

You are right that there is a lot of code repetition. However, proper argument processing with viper is explained at a different chapter. The main idea here is to understand the logic of the program.