From 3afe35b44f28cffbefe1a0f41b70a2c3ba1b4ccb Mon Sep 17 00:00:00 2001 From: Carlosokumu Date: Wed, 9 Oct 2024 16:25:25 +0300 Subject: [PATCH] remove setup driver --- driver/setup_driver .go | 55 ----------------------------------------- 1 file changed, 55 deletions(-) delete mode 100644 driver/setup_driver .go diff --git a/driver/setup_driver .go b/driver/setup_driver .go deleted file mode 100644 index 673d417..0000000 --- a/driver/setup_driver .go +++ /dev/null @@ -1,55 +0,0 @@ -package driver - -import ( - "encoding/json" - "log" - "os" -) - -type Step struct { - Input string `json:"input"` - ExpectedContent string `json:"expectedContent"` -} - -type Group struct { - Name string `json:"name"` - Steps []Step `json:"steps"` -} - -type Session struct { - Name string `json:"name"` - Groups []Group `json:"groups"` -} - -func ReadData() []Session { - data, err := os.ReadFile("test_setup.json") - if err != nil { - log.Fatalf("Failed to read file: %v", err) - } - // Unmarshal JSON data - var sessions []Session - err = json.Unmarshal(data, &sessions) - if err != nil { - log.Fatalf("Failed to unmarshal JSON: %v", err) - } - - return sessions -} - -func FilterGroupsByName(groups []Group, name string) []Group { - var filteredGroups []Group - for _, group := range groups { - if group.Name == name { - filteredGroups = append(filteredGroups, group) - } - } - return filteredGroups -} - -func Map[T any, U any](input []T, fn func(T) U) []U { - result := make([]U, len(input)) - for i, v := range input { - result[i] = fn(v) - } - return result -}