feat(ReverseEngine):初始化工程
This commit is contained in:
@@ -0,0 +1,35 @@
|
||||
/*
|
||||
* @Author : huangzj
|
||||
* @Time : 2020/4/17 14:41
|
||||
* @Description:
|
||||
*/
|
||||
|
||||
package util
|
||||
|
||||
import (
|
||||
"gopkg.in/ini.v1"
|
||||
"strconv"
|
||||
)
|
||||
|
||||
func GenerateConfigBool(key string, real *bool, section *ini.Section) {
|
||||
if section.Key(key).String() != "false" {
|
||||
*real = true
|
||||
return
|
||||
}
|
||||
*real = false
|
||||
}
|
||||
|
||||
func GenerateConfig(key string, real string, section *ini.Section) {
|
||||
if section.Key(key).String() != "" {
|
||||
real = section.Key(key).String()
|
||||
}
|
||||
}
|
||||
|
||||
func GenerateConfigInt(key string, real int, section *ini.Section) {
|
||||
if section.Key(key).String() != "" {
|
||||
value, err := strconv.Atoi(section.Key(key).String())
|
||||
if err == nil {
|
||||
real = value
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user