[agent-go] - 去除本地环境信息的默认设置,优化启动逻辑
This commit is contained in:
@@ -4,7 +4,6 @@ import (
|
||||
"bytes"
|
||||
"fmt"
|
||||
"github.com/go-playground/validator/v10"
|
||||
"reflect"
|
||||
"runtime"
|
||||
"text/template"
|
||||
"wdd.io/agent-common/assert"
|
||||
@@ -104,16 +103,3 @@ func ParseEnvToApplyFile(environment any, applyTemplate string, applyFilePath st
|
||||
|
||||
return true
|
||||
}
|
||||
|
||||
// CopySameFields 利用反射,将a中的所有同名字段的值 复制到b中的对应字段
|
||||
func CopySameFields(a, b interface{}) {
|
||||
va := reflect.ValueOf(a).Elem()
|
||||
vb := reflect.ValueOf(b).Elem()
|
||||
|
||||
for i := 0; i < va.NumField(); i++ {
|
||||
fieldName := va.Type().Field(i).Name
|
||||
if vb.FieldByName(fieldName).IsValid() {
|
||||
vb.FieldByName(fieldName).Set(va.Field(i))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user