agon

command module
v0.0.0-...-fe7d10f Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 4, 2017 License: Apache-2.0 Imports: 6 Imported by: 0

README

agon

agon 这个名字起源于希腊神话中的竞赛之神,胜利女神。这个项目存储了Golang开发常用的类库。

安装

go get github.com/biezhi/agon

使用

输出彩色文本
color.Println(color.Red, "|| Hello World")
color.Println(color.Green, "|| Hello World")
color.Println(color.Yellow, "|| Hello World")
color.Println(color.Purple, "|| Hello %s", "jack")
日志
//log.ConfigLog("test.log")
log.Info("Hello Rose")
log.Debug("Hello %s", "jack")
log.Warn("Hello %s", "jack")
log.Trace("Hello %s", "jack")
log.Error("Hello %s", "jack")
JSON解析
加载一个配置文件
configMap := LoadJson("config.json")
fmt.Println(configMap["api_key"])
字符串转换为JSON对象
str := "{\"name\":\"jack\", \"age\": 20}"
json := json.NewJson(str)
fmt.Println(json.Get("age"))
fmt.Println(json.Get("name"))
fmt.Println(json.ToString())
类型转换为JSON
p := Person{Name:"Rose", Age:20}
fmt.Println(json.Stringify(p))

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
ini
Package uuid provides implementation of Universally Unique Identifier (UUID).
Package uuid provides implementation of Universally Unique Identifier (UUID).

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL