From ebd37af4ef79c9db30f8ee5ac32d186a1d90525f Mon Sep 17 00:00:00 2001 From: Kyle Havlovitz Date: Thu, 12 Jan 2017 16:49:44 -0500 Subject: [PATCH] Style tweaks and vendor.json cleanup --- command/agent/command.go | 10 +++++----- vendor/vendor.json | 20 -------------------- 2 files changed, 5 insertions(+), 25 deletions(-) diff --git a/command/agent/command.go b/command/agent/command.go index 8350ec8a1..3e909d654 100644 --- a/command/agent/command.go +++ b/command/agent/command.go @@ -564,7 +564,7 @@ func (c *Config) discoverGCEHosts(logger *log.Logger) ([]string, error) { logger.Printf("[INFO] agent: Discovering GCE hosts with tag %s in zones: %s", config.TagValue, strings.Join(zones, ", ")) - servers := []string{} + var servers []string for _, zone := range zones { addresses, err := gceInstancesAddressesForZone(logger, ctx, computeService, config.ProjectName, zone, config.TagValue) if err != nil { @@ -611,7 +611,7 @@ func gceProjectIDFromMetadata(logger *log.Logger) (string, error) { // gceDiscoverZones discovers a list of zones from a supplied zone pattern, or // all of the zones available to a project. func gceDiscoverZones(logger *log.Logger, ctx context.Context, computeService *compute.Service, project, pattern string) ([]string, error) { - zones := []string{} + var zones []string if pattern != "" { logger.Printf("[INFO] agent: Discovering zones for project %s matching pattern: %s", project, pattern) @@ -641,7 +641,7 @@ func gceDiscoverZones(logger *log.Logger, ctx context.Context, computeService *c // and zone, matching the supplied tag. Only the private IP addresses are // returned, but ID is also logged. func gceInstancesAddressesForZone(logger *log.Logger, ctx context.Context, computeService *compute.Service, project, zone, tag string) ([]string, error) { - addresses := []string{} + var addresses []string call := computeService.Instances.List(project, zone) if err := call.Pages(ctx, func(page *compute.InstanceList) error { for _, v := range page.Items { @@ -842,13 +842,13 @@ func (c *Command) retryJoin(config *Config, errCh chan<- struct{}) { if err != nil { logger.Printf("[ERROR] agent: Unable to query EC2 instances: %s", err) } - logger.Printf("[INFO] agent: Discovered %d servers from EC2...", len(servers)) + logger.Printf("[INFO] agent: Discovered %d servers from EC2", len(servers)) case config.RetryJoinGCE.TagValue != "": servers, err = config.discoverGCEHosts(logger) if err != nil { logger.Printf("[ERROR] agent: Unable to query GCE insances: %s", err) } - logger.Printf("[INFO] agent: Discovered %d servers from GCE.", len(servers)) + logger.Printf("[INFO] agent: Discovered %d servers from GCE", len(servers)) } servers = append(servers, config.RetryJoin...) diff --git a/vendor/vendor.json b/vendor/vendor.json index 1354f34af..6fd0261fd 100644 --- a/vendor/vendor.json +++ b/vendor/vendor.json @@ -2,18 +2,6 @@ "comment": "", "ignore": "test", "package": [ - { - "path": "appengine", - "revision": "" - }, - { - "path": "appengine_internal", - "revision": "" - }, - { - "path": "appengine_internal/base", - "revision": "" - }, { "checksumSHA1": "ZLRh6zW4/DnVsGpgtt+ZiIaEFKc=", "path": "cloud.google.com/go/compute/metadata", @@ -26,10 +14,6 @@ "revision": "bfdc39bde7a3c8dd361ea7fcdb69e7a41a475bb9", "revisionTime": "2016-12-01T15:27:07Z" }, - { - "path": "git", - "revision": "" - }, { "checksumSHA1": "JhyS/zIicgtrSasHSZ6WtXGWJVk=", "path": "github.com/DataDog/datadog-go/statsd", @@ -911,10 +895,6 @@ "path": "google.golang.org/grpc/transport", "revision": "708a7f9f3283aa2d4f6132d287d78683babe55c8", "revisionTime": "2016-12-02T18:43:27Z" - }, - { - "path": "log", - "revision": "" } ], "rootPath": "github.com/hashicorp/consul"