反复存档会发生runtime.throw

反复存档会发生runtime.throw
读了一次就不再读。。。。
This commit is contained in:
khjde1207 2016-12-27 22:50:32 +09:00 committed by GitHub
parent 0c42e682a6
commit 8155c94ffc
1 changed files with 4 additions and 1 deletions

View File

@ -43,7 +43,10 @@ func Load() {
f, _ := os.Open("i18n")
names, _ := f.Readdirnames(-1)
f.Close()
if len(Locales) == len(names)-1 {
return
}
for _, name := range names {
if !strings.HasSuffix(name, ".json") {
continue