-
Notifications
You must be signed in to change notification settings - Fork 18
/
Copy pathos.go
76 lines (68 loc) · 1.64 KB
/
os.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
66
67
68
69
70
71
72
73
74
75
76
package uaparser
var (
linux = &itemSpec{
name: "Linux",
mustContains: []string{"Linux"},
mustNotContains: []string{"Android"},
}
macOS = &itemSpec{
name: "Mac OS",
mustContains: []string{"Mac OS", "Macintosh"},
mustNotContains: []string{"iPad", "iPhone", "iPod"},
versionSplitters: [][]string{
[]string{"Mac OS ", ";"},
[]string{"Mac OS ", ")"},
},
}
windows = &itemSpec{
name: "Windows",
mustContains: []string{"Windows"},
mustNotContains: []string{"Windows Phone"},
versionSplitters: [][]string{
[]string{"Windows ", ";"},
},
}
android = &itemSpec{
name: "Android",
mustContains: []string{"Android"},
mustNotContains: []string{"Windows Phone"},
versionSplitters: [][]string{
[]string{"Android ", ";"},
[]string{"Android-", " "},
},
}
iOS = &itemSpec{
name: "iOS",
mustContains: []string{"CPU", "OS", "like Mac OS X", "iphone os"},
mustNotContains: []string{"Windows Phone"},
versionSplitters: [][]string{
[]string{"CPU iPhone OS ", " "},
[]string{"CPU OS ", " "},
},
}
wpOS = &itemSpec{
name: "Windows Phone OS",
mustContains: []string{"Windows Phone OS", "Windows Phone"},
mustNotContains: []string{},
versionSplitters: [][]string{
[]string{"Windows Phone OS ", ";"},
},
}
playstationOS = &itemSpec{
name: "PlayStation OS",
mustContains: []string{"PlayStation", "PLAYSTATION"},
versionSplitters: [][]string{
[]string{"PLAYSTATION", "3"},
[]string{"PlayStation", "4"},
},
}
_OS = []*itemSpec{
linux,
macOS,
windows,
android,
iOS,
wpOS,
playstationOS,
}
)