Merge pull request #349 from justinsb/govet_fixes

govet fixes
This commit is contained in:
Justin Santa Barbara 2016-08-26 02:16:12 -04:00 committed by GitHub
commit 9d7a7fc6e8
7 changed files with 7 additions and 7 deletions

View File

@ -57,7 +57,7 @@ func (c *DeleteSecretCmd) Run(args []string) error {
}
if len(secrets) == 0 {
return fmt.Errorf("secret %q not found")
return fmt.Errorf("secret not found")
}
if len(secrets) != 1 {

View File

@ -93,7 +93,7 @@ func (e *Instance) Find(c *fi.Context) (*Instance, error) {
request.Attribute = aws.String("userData")
response, err := cloud.EC2.DescribeInstanceAttribute(request)
if err != nil {
return nil, fmt.Errorf("error querying EC2 for user metadata for instance %q: %v", *i.InstanceId)
return nil, fmt.Errorf("error querying EC2 for user metadata for instance %q: %v", *i.InstanceId, err)
}
if response.UserData != nil {
b, err := base64.StdEncoding.DecodeString(aws.StringValue(response.UserData.Value))

View File

@ -520,5 +520,5 @@ func (c *AWSCloud) FindDNSHostedZone(clusterDNSName string) (string, error) {
return id, nil
}
return "", fmt.Errorf("Found multiple hosted zones matching cluster %q; please specify the ID of the zone to use")
return "", fmt.Errorf("Found multiple hosted zones matching cluster %q; please specify the ID of the zone to use", clusterDNSName)
}

View File

@ -65,7 +65,7 @@ func (ha HashAlgorithm) FromString(s string) (*Hash, error) {
}
if len(s) != l {
return nil, fmt.Errorf("invalid %q hash - unexpected length %s", ha, len(s))
return nil, fmt.Errorf("invalid %q hash - unexpected length %d", ha, len(s))
}
hashValue, err := hex.DecodeString(s)

View File

@ -29,7 +29,7 @@ func (c *VFSContext) ReadFile(location string) ([]byte, error) {
// Handle our special case schemas
u, err := url.Parse(location)
if err != nil {
return nil, fmt.Errorf("error parsing location %q - not a valid URI")
return nil, fmt.Errorf("error parsing location %q - not a valid URI", location)
}
switch u.Scheme {

View File

@ -1520,7 +1520,7 @@ func DeleteIAMRole(cloud fi.Cloud, r *ResourceTracker) error {
}
_, err := c.IAM.DeleteRolePolicy(request)
if err != nil {
return fmt.Errorf("error deleting IAM role policy %q %q", roleName, policyName, err)
return fmt.Errorf("error deleting IAM role policy %q %q: %v", roleName, policyName, err)
}
}

View File

@ -623,7 +623,7 @@ func GetInstanceUserData(cloud *awsup.AWSCloud, instanceID string) ([]byte, erro
request.Attribute = aws.String("userData")
response, err := cloud.EC2.DescribeInstanceAttribute(request)
if err != nil {
return nil, fmt.Errorf("error querying EC2 for user metadata for instance %q: %v", instanceID)
return nil, fmt.Errorf("error querying EC2 for user metadata for instance %q: %v", instanceID, err)
}
if response.UserData != nil {
b, err := base64.StdEncoding.DecodeString(aws.StringValue(response.UserData.Value))