-
Notifications
You must be signed in to change notification settings - Fork 0
/
DataSetsStorage.go
47 lines (37 loc) · 923 Bytes
/
DataSetsStorage.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
package main
import (
"fmt"
"log"
"strings"
companyDataset "github.com/ttimt/LearningGolang/company"
)
// DataSetsStorage struct
type DataSetsStorage struct {
Companies []*companyDataset.Company
}
// DataSets
var DataSets DataSetsStorage
// PrintAllDataSets prints
func (DataSetsStorage DataSetsStorage) printAllDataSets() {
// Print all company data sets
for _, ds := range DataSetsStorage.Companies {
fmt.Println("Data set (company) printing: ", ds)
for _, m := range ds.Machines() {
fmt.Println("Machine printing: ", m)
for _, t := range m.Tasks() {
fmt.Println("specificTask printing: ", t)
}
}
}
}
// CreateDataSet creates
func createDataSet(DataSetKind string) interface{} {
var DataSet interface{}
switch strings.ToLower(DataSetKind) {
case "company":
DataSet = companyDataset.CreateCompany(1.0, 0)
default:
log.Fatal("No such data set kind found!")
}
return DataSet
}