forked from ashmintech/golang-advanced-branching
-
Notifications
You must be signed in to change notification settings - Fork 0
/
vehicle.go
65 lines (47 loc) · 1.19 KB
/
vehicle.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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
package main
import (
)
// Values array for the feedback.json file
// Model array for the feedback.json file
type rating float32
const (
extraPositive rating = 1.2
positive rating = 0.6
negative rating = -0.6
initial rating = 5.0
extraNegative rating = -1.2
)
func init() {
/*
inventory = []vehicle{
bike{"FTR 1200", "Indian"},
bike{"Iron 1200", "Harley"},
car{"Sonata", "Hyundai", "Sedan"},
car{"SantaFe", "Hyundai", "SUV"},
car{"Civic", "Honda", "Hatchback"},
car{"A5", "Audi", "Coupe"},
car{"Mazda6", "Mazda", "Sedan"},
car{"CRV", "Honda", "SUV"},
car{"Camry", "Toyota", "Sedan"},
truck{"F-150", "Ford", "Truck"},
truck{"RAM1500", "Dodge", "Truck"}}
*/
// vehicleResult = make(map[string]feedbackResult)
}
func main() {
// Generate ratings for the different vehicles
// Print ratings for the different vehicles
}
/*
func readJSONFile() Values {
jsonFile, err := os.Open("feedback.json")
if err != nil {
log.Fatal("File not found")
}
defer jsonFile.Close()
byteValue, _ := ioutil.ReadAll(jsonFile)
var content Values
json.Unmarshal(byteValue, &content)
return content
}
*/