From cceeda2762abf5dc3479c824e6a52e0dc1e050e6 Mon Sep 17 00:00:00 2001 From: Kensei Nakada <44139130+sanposhiho@users.noreply.github.com> Date: Wed, 10 Mar 2021 23:05:11 +0900 Subject: [PATCH] Fix: small bugs (#21) --- realmain/check.go | 6 +++++- realmain/mockgen.go | 1 + 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/realmain/check.go b/realmain/check.go index 7b0a864..63f82c3 100644 --- a/realmain/check.go +++ b/realmain/check.go @@ -61,7 +61,11 @@ func (r Runner) Check() { if m.CheckSum != checksum { // mock is not up to date - log.Printf("[WARN] mock is not up to date. source: %s, destination: %s", source, destination) + if source == "" { + log.Printf("[WARN] mock is not up to date. destination: %s", destination) + } else { + log.Printf("[WARN] mock is not up to date. source: %s, destination: %s", source, destination) + } isFail = true } return nil diff --git a/realmain/mockgen.go b/realmain/mockgen.go index 30fe646..907df44 100644 --- a/realmain/mockgen.go +++ b/realmain/mockgen.go @@ -18,6 +18,7 @@ func (r Runner) Mockgen() { g, _ := errgroup.WithContext(context.Background()) for _, m := range ch.Mocks { + m := m g.Go(func() error { var destination string switch m.Mode {