Go struct with methods to handle input. Good idea or Bad idea based on the given situation?
I have the following code below im deciding on either making it just a struct for input or creating a struct with methods to process individual input based on what the api takes. The api can take the following fields...
I'm thinking of going with city, UK post, CA post, and US zip. I have the following code below but im not sure which approach is better. Checking the input and processing it with checks for each or creating methods for the struct so it can have the ability to process those inputs individually. Any thoughts? The code is posted below.
1 Reply
Code is still in works but id rather not get too involved witht the setup if it turns out to be unnecessary