diff options
| author | Dmitry Vyukov <dvyukov@google.com> | 2019-03-28 15:30:18 +0100 |
|---|---|---|
| committer | Dmitry Vyukov <dvyukov@google.com> | 2019-03-28 15:30:18 +0100 |
| commit | 4a9fce1952b2b4742bd07bc5137c75b0225d56ab (patch) | |
| tree | b4286fe6700b5c4e789e55a1921937acd8392a52 /pkg | |
| parent | 742f448304a916ae83bcdadf7e3be76c5464b37b (diff) | |
all: fix warnings pointed to by golangci-lint
Update #977
Diffstat (limited to 'pkg')
| -rw-r--r-- | pkg/compiler/consts.go | 3 | ||||
| -rw-r--r-- | pkg/csource/csource_test.go | 2 | ||||
| -rw-r--r-- | pkg/ifuzz/ifuzz_test.go | 2 | ||||
| -rw-r--r-- | pkg/ipc/ipc_test.go | 2 | ||||
| -rw-r--r-- | pkg/repro/repro_test.go | 2 |
5 files changed, 5 insertions, 6 deletions
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 } |
