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 -}