You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: render.go
    path of file: ./repos/erda/internal/core/openapi/legacy/component-protocol/scenarios/action/components/actionForm
    
    the code of the file until where you have to start completion: // Copyright (c) 2021 Terminus, Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//      http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific lan
    
func GenResourceProps(local *i18n.LocaleResource, actionExt *apistructs.ExtensionVersion) (props []apistructs.FormPropItem, err error) {
	if actionExt == nil {
		err = fmt.Errorf("empty action extension")
		return
	}

	var job diceyml.Job
	diceYmlStr, err := yaml.Marshal(actionExt.Dice)
	if err != nil {
		err = fmt.Errorf("failed to marshal dice yaml, error:%v", err)
		return
	}

	diceYml, err := diceyml.New(diceYmlStr, false)
	if err != nil {
		err = fmt.Errorf("failed to parse action dice spec, error:%v", err)
		return
	}
	for k := range diceYml.Obj().Jobs {
		job = *diceYml.Obj().Jobs[k]
		break
	}

	// resourceFormGroup
	// fromGroup下会根据resource 构建一个资源列表框
	GroupResource := "resources"
	resourceFormGroup := apistructs.FormPropItem{
		Key:       GroupResource,
		Component: "formGroup",
		Group:     GroupResource,
		ComponentProps: map[string]interface{}{
			"title":         local.Get("runResource"),
			"expandable":    true,
			"defaultExpand": false,
		},
	}
	// 动态注入：cpu默认值
	resourceCpu := apistructs.FormPropItem{
		Label:          local.Get("cpu"),
		Component:      "inputNumber",
		Key:            GroupResource + "." + "cpu",
		Group:          GroupResource,
		ComponentProps: map[string]interface{}{},
		DefaultValue:   job.Resources.CPU,
	}
	// 动态注入：mem默认值
	resourceMem := apistructs.FormPropItem{
		Label:          "mem(MB)",
		Component:      "inputNumber",
		Key:            GroupResource + "." + "mem",
		Group:          GroupResource,
		ComponentProps: map[string]interface{}{},
		DefaultValue:   job.Resources.Mem,
	}

	props = append(props, resourceFormGroup, resourceCpu, resourceMem)
	return
}