Skip to content

Commit 06e619e

Browse files
committed
fix lint
1 parent 360ace2 commit 06e619e

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

internal/verifier/pprof.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,13 @@ func (verifier *Verifier) MaybeStartPeriodicHeapProfileCollection(ctx context.Co
3232
func collectHeapUsage() {
3333
heapFileName := fmt.Sprintf("heap-%s.out", time.Now().UTC().Format("20060102T150405Z"))
3434
heapFile, err := os.Create(heapFileName)
35-
defer heapFile.Close()
3635

3736
if err != nil {
3837
panic(err)
3938
}
4039

40+
defer heapFile.Close()
41+
4142
err = pprof.Lookup("heap").WriteTo(heapFile, 0)
4243
if err != nil {
4344
panic(err)

main/migration_verifier.go

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,11 @@ func handleArgs(ctx context.Context, cCtx *cli.Context) (*verifier.Verifier, err
212212
v.SetNumWorkers(cCtx.Int(numWorkers))
213213
v.SetGenerationPauseDelayMillis(time.Duration(cCtx.Int64(generationPauseDelay)))
214214
v.SetWorkerSleepDelayMillis(time.Duration(cCtx.Int64(workerSleepDelay)))
215-
v.SetPprofInterval(cCtx.String(pprofInterval))
215+
216+
err = v.SetPprofInterval(cCtx.String(pprofInterval))
217+
if err != nil {
218+
return nil, err
219+
}
216220

217221
partitionSizeMB := cCtx.Uint64(partitionSizeMB)
218222
if partitionSizeMB != 0 {
@@ -226,9 +230,6 @@ func handleArgs(ctx context.Context, cCtx *cli.Context) (*verifier.Verifier, err
226230
v.SetStartClean(cCtx.Bool(startClean))
227231
logPath := cCtx.String(logPath)
228232
v.SetLogger(logPath)
229-
if err != nil {
230-
return nil, err
231-
}
232233
if cCtx.Bool(verifyAll) {
233234
if len(cCtx.StringSlice(srcNamespace)) > 0 || len(cCtx.StringSlice(dstNamespace)) > 0 {
234235
return nil, errors.Errorf("Setting both verifyAll and explicit namespaces is not supported")

0 commit comments

Comments
 (0)