Documentation
¶
Overview ¶
Package comptime 提供了编译期相关的处理方式
go 以 //go:build 的方式区别编译内容,目前支持以下标签:
- development 表示开发环境,Mode 会被赋为 Development;
- 其它情况下,则 Mode 的值永远是 Production;
Index ¶
Constants ¶
View Source
const ( Production int = iota // 运行于生产环境 Development // 运行于开发环境 )
View Source
const Mode = defaultMode
Mode 当前的运行的环境
这是个编译期的常量,默认情况下始终是 Production, 只有在编译时指定了 development 标签才会为 Development。
Variables ¶
This section is empty.
Functions ¶
func DebugRouter ¶
DebugRouter 在 Development 环境下为 r 提供一组测试用的 API
path 测试路径; id 在取地址参数出错时的 problem id;
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.