我试图用xmlsec1实用程序验证XML(附在问题的底部)签名.但是,在执行命令时
xmlsec1 --verify test.xml
Run Code Online (Sandbox Code Playgroud)
我正在跟踪堆栈跟踪:
func = xmlSecXPathDataExecute:file = xpath.c:line = 273:obj = unknown:subj = xmlXPtrEval:error = 5:libxml2库函数失败:expr = xpointer(id('uuid-73c06e86-88d2-4204-91f4-3d484bc782cc' ))func = xmlSecXPathDataListExecute:file = xpath.c:line = 373:obj = unknown:subj = xmlSecXPathDataExecute:error = 1:xmlsec库函数失败:func = xmlSecTransformXPathExecute:file = xpath.c:line = 483:obj = xpointer :subj = xmlSecXPathDataExecute:error = 1:xmlsec库函数失败:func = xmlSecTransformDefaultPushXml:file = transforms.c:line = 2411:obj = xpointer:subj = xmlSecTransformExecute:error = 1:xmlsec库函数失败:func = xmlSecTransformCtxXmlExecute:file = transforms.c:line = 1242:obj = unknown:subj = xmlSecTransformPushXml:error = 1:xmlsec库函数失败:transform = xpointer func = xmlSecTransformCtxExecute:file = transforms.c:line = 1302:obj = …
我有两个结构
type A struct {
a int
b string
}
type B struct {
A
c string
// more fields
}
Run Code Online (Sandbox Code Playgroud)
我想将类型A的变量转换为类型B(A仅定义了对某些部分至关重要的基本字段,而B另一方面包含"完整"数据).
是否可以在Go中,或者我是否必须手动复制字段(或创建方法A.GetB()或类似的东西并使用它将A转换为B)?