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/) 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 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) 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 { if err != nil {
return err return err
} }

View File

@ -50,7 +50,7 @@ func resourceHerokuDrainCreate(d *schema.ResourceData, meta interface{}) error {
var dr *heroku.LogDrain var dr *heroku.LogDrain
err := resource.Retry(2*time.Minute, func() error { 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 err != nil {
if strings.Contains(err.Error(), retryableError) { if strings.Contains(err.Error(), retryableError) {
return err 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 != "" { if keyName, ok := d.Get("key_pair").(string); ok && keyName != "" {
createOpts = &keypairs.CreateOptsExt{ createOpts = &keypairs.CreateOptsExt{
createOpts, CreateOptsBuilder: createOpts,
keyName, KeyName: keyName,
} }
} }
@ -384,8 +384,8 @@ func resourceComputeInstanceV2Create(d *schema.ResourceData, meta interface{}) e
blockDeviceRaw := v.(map[string]interface{}) blockDeviceRaw := v.(map[string]interface{})
blockDevice := resourceInstanceBlockDeviceV2(d, blockDeviceRaw) blockDevice := resourceInstanceBlockDeviceV2(d, blockDeviceRaw)
createOpts = &bootfromvolume.CreateOptsExt{ createOpts = &bootfromvolume.CreateOptsExt{
createOpts, CreateOptsBuilder: createOpts,
blockDevice, BlockDevice: blockDevice,
} }
log.Printf("[DEBUG] Create BFV Options: %+v", createOpts) 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) log.Printf("[DEBUG] schedulerhints: %+v", schedulerHintsRaw)
schedulerHints := resourceInstanceSchedulerHintsV2(d, schedulerHintsRaw[0].(map[string]interface{})) schedulerHints := resourceInstanceSchedulerHintsV2(d, schedulerHintsRaw[0].(map[string]interface{}))
createOpts = &schedulerhints.CreateOptsExt{ createOpts = &schedulerhints.CreateOptsExt{
createOpts, CreateOptsBuilder: createOpts,
schedulerHints, SchedulerHints: schedulerHints,
} }
} }

View File

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

View File

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