get chris's nits.

This commit is contained in:
Matthew Hooker 2017-06-16 17:23:41 -07:00
parent 3898556caa
commit f534b85ee9
No known key found for this signature in database
GPG Key ID: 7B5F933D9CE8C6A1
2 changed files with 8 additions and 9 deletions

11
main.go
View File

@ -75,10 +75,13 @@ func realMain() int {
// Enable checkpoint for panic reporting // Enable checkpoint for panic reporting
config, err := loadConfig() config, err := loadConfig()
if err == nil { if err != nil {
if !config.DisableCheckpoint { fmt.Fprintf(os.Stderr, "Couldn't load config: %s", err)
packer.CheckpointReporter.Enable(config.DisableCheckpointSignature) return 1
} }
if !config.DisableCheckpoint {
packer.CheckpointReporter.Enable(config.DisableCheckpointSignature)
} }
// Create the configuration for panicwrap and wrap our executable // Create the configuration for panicwrap and wrap our executable

View File

@ -2,7 +2,6 @@ package packer
import ( import (
"context" "context"
"fmt"
"log" "log"
"os" "os"
"path/filepath" "path/filepath"
@ -56,7 +55,7 @@ func (c *CheckpointTelemetry) Enable(disableSignature bool) {
func (c *CheckpointTelemetry) baseParams(prefix string) *checkpoint.ReportParams { func (c *CheckpointTelemetry) baseParams(prefix string) *checkpoint.ReportParams {
version := packerVersion.Version version := packerVersion.Version
if packerVersion.VersionPrerelease != "" { if packerVersion.VersionPrerelease != "" {
version += fmt.Sprintf("-%s", packerVersion.VersionPrerelease) version += "-" + packerVersion.VersionPrerelease
} }
return &checkpoint.ReportParams{ return &checkpoint.ReportParams{
@ -69,9 +68,6 @@ func (c *CheckpointTelemetry) baseParams(prefix string) *checkpoint.ReportParams
} }
} }
func (c *CheckpointTelemetry) log(m string, args ...interface{}) {
}
func (c *CheckpointTelemetry) ReportPanic(m string) error { func (c *CheckpointTelemetry) ReportPanic(m string) error {
if !c.enabled { if !c.enabled {
return nil return nil