-
-
Notifications
You must be signed in to change notification settings - Fork 157
Expand file tree
/
Copy pathembed_platforms.go
More file actions
35 lines (27 loc) · 687 Bytes
/
Copy pathembed_platforms.go
File metadata and controls
35 lines (27 loc) · 687 Bytes
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
package main
import (
"runtime"
"TcNo-Acc-Switcher/internal/platform"
_ "embed"
)
//go:embed Platforms.json
var windowsPlatformsJSON []byte
//go:embed Platforms.linux.json
var linuxPlatformsJSON []byte
//go:embed Platforms.mac.json
var macPlatformsJSON []byte
func init() {
platform.SetEmbeddedPlatformsJSON(embeddedPlatformsForOS(runtime.GOOS))
}
// embeddedPlatformsForOS must agree with platform.PlatformsFileName: that names
// the file on disk, this decides what seeds it.
func embeddedPlatformsForOS(goos string) []byte {
switch goos {
case "windows":
return windowsPlatformsJSON
case "darwin":
return macPlatformsJSON
default:
return linuxPlatformsJSON
}
}