This commit is contained in:
Liang Ding 2017-08-08 21:59:40 +08:00
parent eba96fd0b6
commit 2108a9b407
2 changed files with 4 additions and 21 deletions

View File

@ -34,24 +34,9 @@ type mygo struct{}
var Go = mygo{} var Go = mygo{}
func (*mygo) GetCrossPlatforms() []string { func (*mygo) GetCrossPlatforms() []string {
ret := []string{} return []string{
"darwin_amd64", "linux_amd64", "windows_amd64",
toolDir := runtime.GOROOT() + "/pkg/tool" "linux_arm", "darwin_386", "linux_386", "windows_386"}
f, _ := os.Open(toolDir)
names, _ := f.Readdirnames(-1)
f.Close()
for _, name := range names {
subDir, _ := os.Open(toolDir + "/" + name)
tools, _ := subDir.Readdirnames(10)
subDir.Close()
if len(tools) > 5 {
ret = append(ret, name)
}
}
return ret
} }
// GetAPIPath gets the Go source code path. // GetAPIPath gets the Go source code path.

View File

@ -455,11 +455,9 @@
</li> </li>
<li class="hr"></li> <li class="hr"></li>
{{range .crossPlatforms}} {{range .crossPlatforms}}
{{if eq . "darwin_amd64" "linux_amd64" "windows_amd64" "linux_arm" "darwin_386" "linux_386" "windows_386"}}
<li class="{{.}}" onclick="tree.crossCompile('{{.}}');"> <li class="{{.}}" onclick="tree.crossCompile('{{.}}');">
<span class="space"></span> {{.}} <span class="space"></span> {{.}}
</li> </li>
{{end}}
{{end}} {{end}}
<li class="hr"></li> <li class="hr"></li>
<li class="export" onclick="tree.export(this);"> <li class="export" onclick="tree.export(this);">