From 4a9fce1952b2b4742bd07bc5137c75b0225d56ab Mon Sep 17 00:00:00 2001 From: Dmitry Vyukov Date: Thu, 28 Mar 2019 15:30:18 +0100 Subject: all: fix warnings pointed to by golangci-lint Update #977 --- pkg/compiler/consts.go | 3 +-- pkg/csource/csource_test.go | 2 +- pkg/ifuzz/ifuzz_test.go | 2 +- pkg/ipc/ipc_test.go | 2 +- pkg/repro/repro_test.go | 2 +- 5 files changed, 5 insertions(+), 6 deletions(-) (limited to 'pkg') diff --git a/pkg/compiler/consts.go b/pkg/compiler/consts.go index d3556c047..e06319fb6 100644 --- a/pkg/compiler/consts.go +++ b/pkg/compiler/consts.go @@ -164,10 +164,9 @@ func (comp *compiler) assignSyscallNumbers(consts map[string]uint64) { // Updates desc and returns set of unsupported syscalls and flags. func (comp *compiler) patchConsts(consts map[string]uint64) { for _, decl := range comp.desc.Nodes { - switch decl.(type) { + switch n := decl.(type) { case *ast.IntFlags: // Unsupported flag values are dropped. - n := decl.(*ast.IntFlags) var values []*ast.Int for _, v := range n.Values { if comp.patchIntConst(&v.Value, &v.Ident, consts, nil) { diff --git a/pkg/csource/csource_test.go b/pkg/csource/csource_test.go index 773ff2ed8..75e451b9b 100644 --- a/pkg/csource/csource_test.go +++ b/pkg/csource/csource_test.go @@ -60,7 +60,7 @@ func TestGenerate(t *testing.T) { } func testTarget(t *testing.T, target *prog.Target, full bool) { - seed := int64(time.Now().UnixNano()) + seed := time.Now().UnixNano() if os.Getenv("TRAVIS") != "" { seed = 0 // required for deterministic coverage reports } diff --git a/pkg/ifuzz/ifuzz_test.go b/pkg/ifuzz/ifuzz_test.go index 3758f08d2..5a9af21c6 100644 --- a/pkg/ifuzz/ifuzz_test.go +++ b/pkg/ifuzz/ifuzz_test.go @@ -36,7 +36,7 @@ func TestMode(t *testing.T) { } func TestDecode(t *testing.T) { - seed := int64(time.Now().UnixNano()) + seed := time.Now().UnixNano() if os.Getenv("TRAVIS") != "" { seed = 0 // required for deterministic coverage reports } diff --git a/pkg/ipc/ipc_test.go b/pkg/ipc/ipc_test.go index 42d066d08..22c0c96cd 100644 --- a/pkg/ipc/ipc_test.go +++ b/pkg/ipc/ipc_test.go @@ -37,7 +37,7 @@ func initTest(t *testing.T) (*prog.Target, rand.Source, int, EnvFlags) { if testing.Short() { iters = 10 } - seed := int64(time.Now().UnixNano()) + seed := time.Now().UnixNano() if os.Getenv("TRAVIS") != "" { seed = 0 // required for deterministic coverage reports } diff --git a/pkg/repro/repro_test.go b/pkg/repro/repro_test.go index c417b7416..bc6949a97 100644 --- a/pkg/repro/repro_test.go +++ b/pkg/repro/repro_test.go @@ -18,7 +18,7 @@ func initTest(t *testing.T) (*rand.Rand, int) { if testing.Short() { iters = 100 } - seed := int64(time.Now().UnixNano()) + seed := time.Now().UnixNano() if os.Getenv("TRAVIS") != "" { seed = 0 // required for deterministic coverage reports } -- cgit mrf-deployment