From 28a5f8ca8473d548d224edf3a7b68527f0f3ea76 Mon Sep 17 00:00:00 2001 From: mitchell Date: Fri, 4 Oct 2024 15:55:40 -0400 Subject: [PATCH] Remove no-op pops. --- pkg/buildscript/unmarshal_buildexpression.go | 31 -------------------- 1 file changed, 31 deletions(-) diff --git a/pkg/buildscript/unmarshal_buildexpression.go b/pkg/buildscript/unmarshal_buildexpression.go index b157bef1ce..7515205e10 100644 --- a/pkg/buildscript/unmarshal_buildexpression.go +++ b/pkg/buildscript/unmarshal_buildexpression.go @@ -13,7 +13,6 @@ import ( "github.com/ActiveState/cli/internal/errs" "github.com/ActiveState/cli/internal/logging" - "github.com/ActiveState/cli/internal/multilog" "github.com/ActiveState/cli/internal/rtutils/ptr" "github.com/ActiveState/cli/internal/sliceutils" ) @@ -128,12 +127,6 @@ const ( func unmarshalAssignments(path []string, m map[string]interface{}) ([]*Assignment, error) { path = append(path, ctxAssignments) - defer func() { - _, _, err := sliceutils.Pop(path) - if err != nil { - multilog.Error("Could not pop context: %v", err) - } - }() assignments := []*Assignment{} for key, valueInterface := range m { @@ -160,12 +153,6 @@ func unmarshalAssignments(path []string, m map[string]interface{}) ([]*Assignmen func unmarshalValue(path []string, valueInterface interface{}) (*Value, error) { path = append(path, ctxValue) - defer func() { - _, _, err := sliceutils.Pop(path) - if err != nil { - multilog.Error("Could not pop context: %v", err) - } - }() value := &Value{} @@ -236,12 +223,6 @@ func unmarshalValue(path []string, valueInterface interface{}) (*Value, error) { func isAp(path []string, value map[string]interface{}) bool { path = append(path, ctxIsAp) - defer func() { - _, _, err := sliceutils.Pop(path) - if err != nil { - multilog.Error("Could not pop context: %v", err) - } - }() _, hasIn := value[inKey] return !hasIn || sliceutils.Contains(path, ctxAssignments) @@ -249,12 +230,6 @@ func isAp(path []string, value map[string]interface{}) bool { func unmarshalFuncCall(path []string, m map[string]interface{}) (*FuncCall, error) { path = append(path, ctxFuncCall) - defer func() { - _, _, err := sliceutils.Pop(path) - if err != nil { - multilog.Error("Could not pop context: %v", err) - } - }() // m is a mapping of function name to arguments. There should only be one // set of arguments. Since the arguments are key-value pairs, it should be @@ -317,12 +292,6 @@ func unmarshalFuncCall(path []string, m map[string]interface{}) (*FuncCall, erro func unmarshalIn(path []string, inValue interface{}) (*Value, error) { path = append(path, ctxIn) - defer func() { - _, _, err := sliceutils.Pop(path) - if err != nil { - multilog.Error("Could not pop context: %v", err) - } - }() in := &Value{}