How can I assign the string value returned by flag into my struct? I have the following code.
destDbCfg = &dbhelper.DbConfig {}
destDbCfg.Database = flag.String( "destDBName", "", "Destination DB Database Name")
flag.Parse()
Database is a string
Use the *Var
methods to set set values to existing variables from flags, in this case you want flag.StringVar
destDbCfg = &dbhelper.DbConfig{}
flag.StringVar(&destDbCfg.Database, "destDBName", "", "Destination DB Database Name")
flag.Parse()