diff --git a/go/l5.go b/go/l5.go index fe6ec1f..e232f1e 100644 --- a/go/l5.go +++ b/go/l5.go @@ -10,6 +10,7 @@ func main() { err := godotenv.Load() if err != nil { fmt.Println("не") + return } api := os.Getenv("api_key") fmt.Println(api) diff --git a/go/l6.go b/go/l6.go new file mode 100644 index 0000000..f2e57dd --- /dev/null +++ b/go/l6.go @@ -0,0 +1,18 @@ +package main + +import ( + "fmt" + "strings" +) + +func main() { + fmt.Println("Ты кто?") + var pol string + fmt.Scanln(&pol) + ser := strings.ToLower(pol) + if strings.HasPrefix(ser, "серг") { + fmt.Println("Обнаружен сергей") + } else { + fmt.Println("Ты не сергей") + } +} diff --git a/go/output/l5 b/go/output/l5 new file mode 100755 index 0000000..4d2bc74 Binary files /dev/null and b/go/output/l5 differ