問題タブ [xml-encoding]
For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.
xml - Golang の XML エンコーダーがすべてのストリームでタグを閉じない
私は、XML をローカル ファイルと S3 バケットに同時に書き込むストリーミング XML エンコーダーに取り組んでいます。ただし、2 つのローカル ファイルへの書き込みをテストするだけで、ファイルの 1 つに毎回終了タグがないことがわかります。
これが大まかな方法です(エラー処理を省略しています):
の結果file1.xml
は期待どおりで、すべてのタグが適切に閉じられていますがfile2.xml
、終了タグ ( の呼び出しencoder.EncodeToken(xml.EndElement{...})
) が欠落しています。
私は何を間違っていますか?リーダーを S3 にコピーすると、同じ結果を期待できますか?