neda1985 / search

0 stars 1 forks source link

Use flag library #1

Closed fzerorubigd closed 4 years ago

fzerorubigd commented 4 years ago

Some configs are hardcoded, pass them using flags (or if you prefer gnu style, use pflag - https://github.com/ogier/pflag- )

Consider passing port, instead of hardcoding it to 8080 Consider pass data using flags, instead of using .env file set the default to Env version :

host := flag.String("host", os.Getenv("ELASTIC_HOST"), "The elastic host to use")

then get rid of the dotenv library. that's BS.

neda1985 commented 4 years ago

qq what do you mean by passing port ?

neda1985 commented 4 years ago

oh I got what you mean :))) sorry

neda1985 commented 4 years ago

@fzerorubigd I just pushed the changes , would be really nice of you if could have a look at it, then I can close this issue

fzerorubigd commented 4 years ago

Yes, it's ok. I prefer to not use the global variable, but step by step.