我爱占星网 我爱占星网
首页
编程
java
php
前端
首页 编程 java php 前端

如何使用插入顺序Go中的键生成YAML?

I'm using Go-Yaml to serialize some maps to YAML. Is there a way to ensure the serialized YAML is writen with the keys in the order they were inserted into the Go Map? Or will it be necessary to reimplement the Marshal interface myself?

Go maps do not keep track of order of insertion. In order to do this you'd have to implement your own mechanism for reading in the keys and storing the order.

近期文章

  • 带有Golang的Postgresql,问题
  • go + elastigo紧急:运行时错误:索引超出范围
  • 使用事务时Golang Postgres驱动程序出现紧急情况
  • golang cgo无法通过构建模式c共享导出变量
  • 编写openshift扩展
  • CGo:运行时意外信号
  • 解组转义的JSON字符串[重复]
  • golang http文件过多
  • Docker的Golang连续工作流程
  • mplayer无法从golang获取stdin流
  • 如何使用主机从Google App Engine应用程序连接到Compute Engine上的Postgresql数据库
  • 尝试从模型创建表时出错
  • 如何二进制读取Opus文件
  • Beego验证接受无效数据
  • Golang [] byte至PHP字符串
  • 大摇大摆不生成模型信息
  • GoImports杀死html语法高亮显示
  • 从Golang中的二进制文件读取int16
  • 通过cgo被golang程序调用时,sigsuspend不返回
  • libnetwork:错误:“ some_app”的未知命令“ / var / run / docker / netns / 582bd184e561”

Copyright ©2022 我爱占星 All Rights Reserved.

浙ICP备2022030071号-1

部分图文来自网络,如有侵犯您的版权,请告诉我们删除

友情链接:代码精华