This commit is contained in:
Egor Matveev
2024-12-31 00:53:40 +03:00
commit c2659fb49c
16 changed files with 480 additions and 0 deletions

11
app/utils/env.go Normal file
View File

@@ -0,0 +1,11 @@
package utils
import "os"
func GetEnv(env string, defaultValue string) string {
value := os.Getenv(env)
if len(value) == 0 {
return defaultValue
}
return value
}

6
app/utils/errors.go Normal file
View File

@@ -0,0 +1,6 @@
package utils
import "errors"
var ErrIncorrectFormat = errors.New("incorrect_format")
var ErrInternalError = errors.New("internal_error")