Code refactoring

This commit is contained in:
Alexey Khit
2023-07-25 18:05:29 +03:00
parent 922587ed2e
commit ed38122752

View File

@@ -44,6 +44,7 @@ func QuoteSplit(s string) []string {
return a
}
// ReplaceEnvVars - support format ${CAMERA_PASSWORD} and ${RTSP_USER:admin}
func ReplaceEnvVars(text string) string {
re := regexp.MustCompile(`\${([^}{]+)}`)
return re.ReplaceAllStringFunc(text, func(match string) string {