V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
The Go Programming Language
http://golang.org/
Go Playground
Go Projects
Revel Web Framework
darasion
V2EX  ›  Go 编程语言

配置文件解析库,哪个最好用?

  •  
  •   darasion · 2016-03-28 14:13:48 +08:00 · 1903 次点击
    这是一个创建于 2922 天前的主题,其中的信息可能已经有所发展或是发生改变。
    第 1 条附言  ·  2016-03-29 14:39:18 +08:00
    大家觉得 gcfg 如何?
    https://gopkg.in/gcfg.v1
    11 条回复    2016-12-20 06:54:14 +08:00
    miyuki
        1
    miyuki  
       2016-03-28 14:16:02 +08:00 via Android
    phoneli
        2
    phoneli  
       2016-03-28 14:16:11 +08:00
    配置文件解析?如果是简单类似 nginx 那种配置文件解析的,自己写一个,也很简单。
    FeiMa
        3
    FeiMa  
       2016-03-28 14:31:16 +08:00
    我是直接使用的 Json 配置文件就是手写 Json 字符串。
    cobopanda
        4
    cobopanda  
       2016-03-28 18:11:30 +08:00
    toml
    orvice
        5
    orvice  
       2016-03-28 19:47:27 +08:00
    gamexg
        6
    gamexg  
       2016-03-28 20:23:07 +08:00
    github.com/BurntSushi/toml

    不喜欢 json , json 不能添加注释。
    janxin
        7
    janxin  
       2016-03-28 22:23:58 +08:00
    yibin001
        8
    yibin001  
       2016-03-28 22:38:07 +08:00
    owt5008137
        9
    owt5008137  
       2016-03-29 09:44:27 +08:00 via Android
    https://github.com/owt5008137/libiniloader

    自己写,带扩展语法的 ini 解析
    KiriGiri
        10
    KiriGiri  
       2016-03-29 14:34:05 +08:00 via Android
    上一个重型武器。
    https://github.com/robertkrimen/otto
    纯 go 实现的 js 引擎,可以很好嵌入 go 程序。拿 js 写配置文件。
    xiqingongzi
        11
    xiqingongzi  
       2016-12-20 06:54:14 +08:00 via Android
    github.com/go-ozzo/ozzo-config
    自己做项目时用的这个还不错。可以参考下。 go 新手:)
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   4567 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 26ms · UTC 01:06 · PVG 09:06 · LAX 18:06 · JFK 21:06
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.