From d90ae7837a1dde28b1591be50e6b70d3c9beb2a5 Mon Sep 17 00:00:00 2001 From: Parvej Ahammad Date: Sun, 16 Oct 2022 17:25:28 +0600 Subject: [PATCH] Contact removed' --- README.md | 9 --------- concat_test.go | 16 ---------------- js_array_method.go | 4 ---- 3 files changed, 29 deletions(-) delete mode 100644 concat_test.go diff --git a/README.md b/README.md index 1f10a75..2082c48 100644 --- a/README.md +++ b/README.md @@ -130,13 +130,4 @@ FindIndex(users, "User1") FindIndex(users, "User5") //-1 -``` -### Concat - -``` -users1 := []User{{Id: 10, Name: "John"}, {Id: 11, Name: "Doe"}, {Id: 12, Name: "Sabrina"}} -users2 := []User{{Id: 10, Name: "John"}, {Id: 11, Name: "Doe"}, {Id: 12, Name: "Sabrina"}} -Concat(users1, users2) -//{{Id: 10, Name: "John"}, {Id: 11, Name: "Doe"}, {Id: 12, Name: "Sabrina"}, {Id: 10, Name: "John"}, {Id: 11, Name: "Doe"}, {Id: 12, Name: "Sabrina"}} - ``` \ No newline at end of file diff --git a/concat_test.go b/concat_test.go deleted file mode 100644 index 66169d8..0000000 --- a/concat_test.go +++ /dev/null @@ -1,16 +0,0 @@ -package js_array_method - -import ( - "testing" -) - -func TestConcat(t *testing.T) { - users1 := []User{{Id: 10, Name: "John"}, {Id: 11, Name: "Doe"}, {Id: 12, Name: "Sabrina"}} - users2 := []User{{Id: 10, Name: "John"}, {Id: 11, Name: "Doe"}, {Id: 12, Name: "Sabrina"}} - - users := Concat(users1, users2) - - if len(users) != 6 { - t.Errorf("Expected 6 got %d", len(users)) - } -} diff --git a/js_array_method.go b/js_array_method.go index b047da2..45b76ff 100644 --- a/js_array_method.go +++ b/js_array_method.go @@ -120,7 +120,3 @@ func Reverse[T any](input []T) []T { return output } - -func Concat[T any](slice1 []T, slice2 []T) []T { - return append(slice1, slice2...) -}