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{}
func (*mygo) GetCrossPlatforms() []string {
ret := []string{}
toolDir := runtime.GOROOT() + "/pkg/tool"
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
return []string{
"darwin_amd64", "linux_amd64", "windows_amd64",
"linux_arm", "darwin_386", "linux_386", "windows_386"}
}
// GetAPIPath gets the Go source code path.

View File

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