From 01330e7ed78b611b64aa9fbaf38bb83f7c4e5c95 Mon Sep 17 00:00:00 2001 From: Roman Khimov Date: Wed, 14 Aug 2019 20:29:32 +0300 Subject: [PATCH] cli: add error return check for compiler.CompileAndInspect() GolangCI complains: Error return value of compiler.CompileAndInspect is not checked (from errcheck) --- cli/smartcontract/smart_contract.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cli/smartcontract/smart_contract.go b/cli/smartcontract/smart_contract.go index 8501153b8..2dd69bf94 100644 --- a/cli/smartcontract/smart_contract.go +++ b/cli/smartcontract/smart_contract.go @@ -254,6 +254,8 @@ func inspect(ctx *cli.Context) error { if len(src) == 0 { return cli.NewExitError(errNoInput, 1) } - compiler.CompileAndInspect(src) + if err := compiler.CompileAndInspect(src); err != nil { + return cli.NewExitError(err, 1) + } return nil }