*: 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 <[email protected]>
This commit is contained in:
Satoshi Fujimoto
2017-11-07 09:51:29 +09:00
committed by FUJITA Tomonori
parent 5f9347d0d8
commit 8f0c42dbff
3 changed files with 4 additions and 5 deletions
+1 -1
View File
@@ -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"))
+2 -2
View File
@@ -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
+1 -2
View File
@@ -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)
}