mirror of
https://github.com/ManyakRus/starter.git
synced 2025-11-27 23:18:34 +02:00
сделал telegram_bot
This commit is contained in:
19
microl/microl.go
Normal file
19
microl/microl.go
Normal file
@@ -0,0 +1,19 @@
|
||||
// пакет для микрофункций с логгером
|
||||
|
||||
package microl
|
||||
|
||||
import (
|
||||
"github.com/ManyakRus/starter/log"
|
||||
"os"
|
||||
)
|
||||
|
||||
// Getenv - возвращает переменную окружения
|
||||
func Getenv(Name string, IsRequired bool) string {
|
||||
TextError := "Need fill OS environment variable: "
|
||||
Otvet := os.Getenv(Name)
|
||||
if IsRequired == true && Otvet == "" {
|
||||
log.Error(TextError + Name)
|
||||
}
|
||||
|
||||
return Otvet
|
||||
}
|
||||
Reference in New Issue
Block a user