diff options
author | Satoshi Fujimoto <satoshi.fujimoto7@gmail.com> | 2017-11-06 14:30:49 +0900 |
---|---|---|
committer | FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> | 2017-11-07 09:51:29 +0900 |
commit | 8f0c42dbfff06f11ef65c14ee23ece050aa38460 (patch) | |
tree | 21382f61845a1f77e9494953af51f8bba3130198 | |
parent | 5f9347d0d82a8cf8f32259e2459d370c14d85fc5 (diff) |
*: Fix problems pointed by 'go vet'
In the near feature (likely in Go1.10),
'go test' will never work if 'go vet' fails.
(See: https://github.com/golang/go/issues/18084)
This commit is for dealing with such a situation
(and also for improving the quality of our code).
Signed-off-by: Satoshi Fujimoto <satoshi.fujimoto7@gmail.com>
-rw-r--r-- | config/util_test.go | 2 | ||||
-rw-r--r-- | packet/bgp/bgp.go | 4 | ||||
-rw-r--r-- | zebra/zapi.go | 3 |
3 files changed, 4 insertions, 5 deletions
diff --git a/config/util_test.go b/config/util_test.go index c29ea70f..872fac67 100644 --- a/config/util_test.go +++ b/config/util_test.go @@ -20,7 +20,7 @@ import ( "testing" ) -func TestdetectConfigFileType(t *testing.T) { +func TestDetectConfigFileType(t *testing.T) { assert := assert.New(t) assert.Equal("toml", detectConfigFileType("bgpd.conf", "toml")) diff --git a/packet/bgp/bgp.go b/packet/bgp/bgp.go index 27206d68..380cbbb2 100644 --- a/packet/bgp/bgp.go +++ b/packet/bgp/bgp.go @@ -3108,13 +3108,13 @@ func flowSpecFragmentParser(rf RouteFamily, args []string) (FlowSpecComponentInt switch c { case BitmaskFlagOpNameMap[BITMASK_FLAG_OP_MATCH]: if op&BITMASK_FLAG_OP_MATCH != 0 { - err := fmt.Errorf("invalid flowspec fragment specifier: '=' flag appears multiple time", cmd) + err := fmt.Errorf("invalid flowspec fragment specifier: '=' flag appears multiple time: %s", cmd) return nil, err } op |= BITMASK_FLAG_OP_MATCH case BitmaskFlagOpNameMap[BITMASK_FLAG_OP_NOT]: if op&BITMASK_FLAG_OP_NOT != 0 { - err := fmt.Errorf("invalid flowspec fragment specifier: '!' flag appears multiple time", cmd) + err := fmt.Errorf("invalid flowspec fragment specifier: '!' flag appears multiple time: %s", cmd) return nil, err } op = op | BITMASK_FLAG_OP_NOT diff --git a/zebra/zapi.go b/zebra/zapi.go index e9e91015..ef6b79d7 100644 --- a/zebra/zapi.go +++ b/zebra/zapi.go @@ -749,7 +749,6 @@ func (c *Client) SendRedistributeDelete(t ROUTE_TYPE) error { } else { return fmt.Errorf("unknown route type: %d", t) } - return nil } func (c *Client) SendIPRoute(vrfId uint16, body *IPRouteBody, isWithdraw bool) error { @@ -1032,7 +1031,7 @@ func (b *InterfaceAddressUpdateBody) Serialize(version uint8) ([]byte, error) { func (b *InterfaceAddressUpdateBody) String() string { return fmt.Sprintf( - "idx: %d, flags: %d, addr: %s/%d", + "idx: %d, flags: %s, addr: %s/%d", b.Index, b.Flags.String(), b.Prefix.String(), b.Length) } |