golang解析json報錯:invalid character '\x00' after top-level value
手動復制字符串:
{"files":["c:/test/output/temp/file_export0000.out","c:/test/output/temp/file_export0001.out","c:/test/output/temp/file_export0002.out","c:/test/output/temp/file_export0003.out","c:/test/output/temp/file_export0004.out"]}
發現沒有問題
原來是封裝傳出字符串的時候出問題了
*len = output.length() + 1; char* out_buf = new char[*len]; memset(out_buf, 0, *len);
output是std::string. 傳出的時候多了0x00
*len = output.length()
就行了