INNER CODE UNIT · Go

generateSecureSecret

sy-vendor/Gobi · config/config.go:646

func generateSecureSecret(length int) string {
	bytes := make([]byte, length)
	rand.Read(bytes)
	return hex.EncodeToString(bytes)
}

// 配置工具函数
func (c *Config) IsDevelopment() bool {
	return getEnvironment() == "dev"
}

func (c *Config) IsProduction() bool {
	return getEnvironment() == "prod"
}

func (c *Config) IsTest() bool {
	return getEnvironment() == "test"
}

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…