Skip to content

Add formatter to errors.Wrapf in driver#241

Merged
mattlandis merged 1 commit intoaws:masterfrom
nak3:unit-test
Nov 26, 2018
Merged

Add formatter to errors.Wrapf in driver#241
mattlandis merged 1 commit intoaws:masterfrom
nak3:unit-test

Conversation

@nak3
Copy link
Copy Markdown
Contributor

@nak3 nak3 commented Nov 26, 2018

Unit test for driver fail with golang v1.11 due to Wrapf call has arguments but no formatting directives error. This patch adds
formatting directives to errors.Wrapf in driver.go for the fix.
Additionally, this PR includes tiny fix in driver.go. Hence it changes
overall:

  • to add formatter to errors.Wrapf
  • to use errors.Wrapf() in run() func.
  • to fix one typo

Issue #, if available:

Fixes #240

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

Unit test for driver fail with golang v1.11 due to `Wrapf call has
arguments but no formatting directives` error. This patch adds
formatting directives to errors.Wrapf in driver.go for the fix.
Additionally, this PR includes tiny fix in driver.go. Hence it changes
overall:

- to add formatter to errors.Wrapf
- to use errors.Wrapf() in run() func.
- to fix one typo
if oldHostVeth, err := netLink.LinkByName(hostVethName); err == nil {
if err = netLink.LinkDel(oldHostVeth); err != nil {
return errors.Wrapf(err, "setup NS network: failed to delete old hostVeth", hostVethName)
return errors.Wrapf(err, "setup NS network: failed to delete old hostVeth %q", hostVethName)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, thanks for fixing this! I noticed the compile issues with 1.11, but didn't have time to find the cause of the problem yet. Had planned to look at it this week.

Copy link
Copy Markdown
Contributor

@mattlandis mattlandis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@mattlandis mattlandis merged commit b995480 into aws:master Nov 26, 2018
@mogren mogren added this to the v1.4 milestone Mar 5, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

unit test for driver fail with newer golang such as v1.11

3 participants