diff --git a/V-for-Go-developers.md b/V-for-Go-developers.md index b3ac249..fc573e4 100644 --- a/V-for-Go-developers.md +++ b/V-for-Go-developers.md @@ -63,7 +63,7 @@ println(numbers) -Filtering a vector +Filtering a slice
@@ -83,6 +83,28 @@ even := numbers.filter(it % 2 == 0)
 
 
 
+Checking if a slice contains an element
+
+
+
+contains := false
+for _, num := range numbers {
+        if num == x {
+            contains = true
+            break
+        }
+    }
+
+
+ + +
+contains := x in numbers
+
+ + + + Reading a file