<分区>
我有一个 PHP
脚本,我在其中创建了一些数组格式(数据结构),我想使用 Golang
转换相同的数组结构。
下面是我的PHP脚本的数组结构
$response['spf']['current_value'] = $spfValue; // this will be the array of strings
$response['spf']['required_value'] = "v=spf1 a include:32782.pppp.com ~all";
$response['spf']['is_verified'] = $isValidSpf; //this will be int
$response['spf']['spf_matched'] = $isMatched; //this will be int
print_r($response);
上述脚本的输出将是名为 SPF 的 key 的 Array
[spf] => Array
(
[current_value] => Array
(
[0] => v=spf1 a -all,
)
[required_value] => v=spf1 a include:32782.pppp.com ~all
[is_verified] => 0
[spf_matched] => 0
)
因为我是 golang
的新手,需要一些 golang 代码来返回与 PHP
脚本相同的输出