You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

35 lines
791 B
Go

package config
import (
"os"
"strings"
)
const (
5 years ago
testFile = `
serial_number : "1.0" #
service_name : #
service_displayname : #
sercice_desc : #
is_dev : false #
out_dir : ./db #
singular_table : true # :true:,false: :gorm.SingularTable
simple : true #
isJsonTag : true #json
mysql_info:
host : 127.0.0.1
port : 3306
username : root
password : qwer
database : oauth_db
`
)
// IsRunTesting Determine whether to use it in a test environment.判断是否在测试环境下使用
func IsRunTesting() bool {
if len(os.Args) > 1 {
return strings.HasPrefix(os.Args[1], "-test")
}
return false
}