I am writing a CLI program in GO and need to be able to pass a rather long list of arguments to the main function. At the moment I am using the standard way of passing arguments (space separated values) and then retrieve 'em using os.Args[index].
So my questions are:
[]string
, so at this level it's just a matter of how much memory is available. But, the comments below are correct. Your system will have its own lower limits that you'll hit first.Without knowing more, I'd recommend a the config file. They make it easy to track different configs/runs, easier to edit than a long list of cmd line args, and you can always write it so that args on the cmd line overwrite values in the config.
Check out awesome-go for libraries that already do this, specifically under the command-line and configuration sections.