From 5ae2318fb96c31299ef507747ef549e8c9bdf64f Mon Sep 17 00:00:00 2001 From: "a.pivkin" Date: Tue, 8 Jul 2025 18:47:29 +0300 Subject: [PATCH] good course by Kirill --- Lec4/go.mod | 3 +++ Lec4/main.go | 15 +++++++++++++++ Lec5/go.mod | 3 +++ Lec5/main.go | 17 +++++++++++++++++ pkg/mod/cache/lock | 0 5 files changed, 38 insertions(+) create mode 100644 Lec4/go.mod create mode 100644 Lec4/main.go create mode 100644 Lec5/go.mod create mode 100644 Lec5/main.go create mode 100644 pkg/mod/cache/lock diff --git a/Lec4/go.mod b/Lec4/go.mod new file mode 100644 index 0000000..a692304 --- /dev/null +++ b/Lec4/go.mod @@ -0,0 +1,3 @@ +module main.go + +go 1.24.4 diff --git a/Lec4/main.go b/Lec4/main.go new file mode 100644 index 0000000..cc0775d --- /dev/null +++ b/Lec4/main.go @@ -0,0 +1,15 @@ +package main + +import ( + "fmt" + "unicode/utf8" + "unsafe" +) + + +func main() { + var kek string = "Федя" + fmt.Printf("Length of %s is: %d\n",kek,len(kek)) + fmt.Printf("Length in chars: %d\n",utf8.RuneCountInString(kek)) + fmt.Printf("Type %T size of %d bytes\n",kek,unsafe.Sizeof(kek)) +} \ No newline at end of file diff --git a/Lec5/go.mod b/Lec5/go.mod new file mode 100644 index 0000000..a692304 --- /dev/null +++ b/Lec5/go.mod @@ -0,0 +1,3 @@ +module main.go + +go 1.24.4 diff --git a/Lec5/main.go b/Lec5/main.go new file mode 100644 index 0000000..201ef12 --- /dev/null +++ b/Lec5/main.go @@ -0,0 +1,17 @@ +package main + +import ( + "fmt" + "strings" +) + + +func main() { + var word1 string + fmt.Scan(&word1) + if strings.Contains(word1,"чат") { + fmt.Println("THIS IS BOT") + return + } + fmt.Println("This is not a bot") +} diff --git a/pkg/mod/cache/lock b/pkg/mod/cache/lock new file mode 100644 index 0000000..e69de29