chore: don't initialise zero-valued structs

This commit is contained in:
andig 2022-08-18 18:33:25 +02:00
parent fce66c644c
commit 14693d2267
35 changed files with 72 additions and 68 deletions

View file

@ -209,10 +209,10 @@ func (cp *ConfigProvider) configureVehicles(conf config) error {
}
// ensure vehicle config has title
ccWithTitle := struct {
var ccWithTitle struct {
Title string
Other map[string]interface{} `mapstructure:",remain"`
}{}
}
if err := util.DecodeOther(cc.Other, &ccWithTitle); err != nil {
return err

View file

@ -112,11 +112,11 @@ func tronityAuthorize(addr string, oc *oauth2.Config) (*oauth2.Token, error) {
}
func tronityToken(conf config, vehicleConf qualifiedConfig) (*oauth2.Token, error) {
cc := struct {
var cc struct {
Credentials vehicle.ClientCredentials
RedirectURI string
Other map[string]interface{} `mapstructure:",remain"`
}{}
}
if err := util.DecodeOther(vehicleConf.Other, &cc); err != nil {
return nil, err