What about this:
```
if nsname, exists := n.Context["nsname"]; !exists {
     return fmt.Errorf("nspath does not exist in network context")
} else {
      context["nspath"] = fmt.Sprintf("/var/run/netns/%s", nsname)
}
return nil
```

I tend to go toward inlining, but I also like the return upon error pattern. If my solution doesn't fit you, I'd go with @proppy on that one.