Enable `go vet -composites` check and fix warnings.

This commit is contained in:
Trevor Pounds 2016-02-12 13:57:39 -08:00 committed by James Nugent
parent e130b2c2dc
commit 79742fc367
6 changed files with 16 additions and 13 deletions

View File

@ -1,5 +1,5 @@
TEST?=$$(GO15VENDOREXPERIMENT=1 go list ./... | grep -v /vendor/)
VETARGS?=-asmdecl -atomic -bool -buildtags -copylocks -methods -nilfunc -printf -rangeloops -shift -structtags -unsafeptr
VETARGS?=-asmdecl -atomic -bool -buildtags -composites -copylocks -methods -nilfunc -printf -rangeloops -shift -structtags -unsafeptr
default: test

View File

@ -43,7 +43,7 @@ func resourceHerokuDomainCreate(d *schema.ResourceData, meta interface{}) error
log.Printf("[DEBUG] Domain create configuration: %#v, %#v", app, hostname)
do, err := client.DomainCreate(app, heroku.DomainCreateOpts{hostname})
do, err := client.DomainCreate(app, heroku.DomainCreateOpts{Hostname: hostname})
if err != nil {
return err
}

View File

@ -50,7 +50,7 @@ func resourceHerokuDrainCreate(d *schema.ResourceData, meta interface{}) error {
var dr *heroku.LogDrain
err := resource.Retry(2*time.Minute, func() error {
d, err := client.LogDrainCreate(app, heroku.LogDrainCreateOpts{url})
d, err := client.LogDrainCreate(app, heroku.LogDrainCreateOpts{URL: url})
if err != nil {
if strings.Contains(err.Error(), retryableError) {
return err

View File

@ -374,8 +374,8 @@ func resourceComputeInstanceV2Create(d *schema.ResourceData, meta interface{}) e
if keyName, ok := d.Get("key_pair").(string); ok && keyName != "" {
createOpts = &keypairs.CreateOptsExt{
createOpts,
keyName,
CreateOptsBuilder: createOpts,
KeyName: keyName,
}
}
@ -384,8 +384,8 @@ func resourceComputeInstanceV2Create(d *schema.ResourceData, meta interface{}) e
blockDeviceRaw := v.(map[string]interface{})
blockDevice := resourceInstanceBlockDeviceV2(d, blockDeviceRaw)
createOpts = &bootfromvolume.CreateOptsExt{
createOpts,
blockDevice,
CreateOptsBuilder: createOpts,
BlockDevice: blockDevice,
}
log.Printf("[DEBUG] Create BFV Options: %+v", createOpts)
}
@ -396,8 +396,8 @@ func resourceComputeInstanceV2Create(d *schema.ResourceData, meta interface{}) e
log.Printf("[DEBUG] schedulerhints: %+v", schedulerHintsRaw)
schedulerHints := resourceInstanceSchedulerHintsV2(d, schedulerHintsRaw[0].(map[string]interface{}))
createOpts = &schedulerhints.CreateOptsExt{
createOpts,
schedulerHints,
CreateOptsBuilder: createOpts,
SchedulerHints: schedulerHints,
}
}

View File

@ -648,8 +648,8 @@ func buildNetworkDevice(f *find.Finder, label, adapterType string) (*types.Virtu
return &types.VirtualDeviceConfigSpec{
Operation: types.VirtualDeviceConfigSpecOperationAdd,
Device: &types.VirtualVmxnet3{
types.VirtualVmxnet{
types.VirtualEthernetCard{
VirtualVmxnet: types.VirtualVmxnet{
VirtualEthernetCard: types.VirtualEthernetCard{
VirtualDevice: types.VirtualDevice{
Key: -1,
Backing: backing,
@ -663,7 +663,7 @@ func buildNetworkDevice(f *find.Finder, label, adapterType string) (*types.Virtu
return &types.VirtualDeviceConfigSpec{
Operation: types.VirtualDeviceConfigSpecOperationAdd,
Device: &types.VirtualE1000{
types.VirtualEthernetCard{
VirtualEthernetCard: types.VirtualEthernetCard{
VirtualDevice: types.VirtualDevice{
Key: -1,
Backing: backing,

View File

@ -33,7 +33,10 @@ func consulFactory(conf map[string]string) (Client, error) {
} else {
username = auth
}
config.HttpAuth = &consulapi.HttpBasicAuth{username, password}
config.HttpAuth = &consulapi.HttpBasicAuth{
Username: username,
Password: password,
}
}
client, err := consulapi.NewClient(config)