From 8155c94ffca519b1e8808b57f2100f8bf6836732 Mon Sep 17 00:00:00 2001 From: khjde1207 Date: Tue, 27 Dec 2016 22:50:32 +0900 Subject: [PATCH] =?UTF-8?q?=E5=8F=8D=E5=A4=8D=E5=AD=98=E6=A1=A3=E4=BC=9A?= =?UTF-8?q?=E5=8F=91=E7=94=9Fruntime.throw?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 反复存档会发生runtime.throw 读了一次就不再读。。。。 --- i18n/locales.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/i18n/locales.go b/i18n/locales.go index e67f5d3..834e302 100644 --- a/i18n/locales.go +++ b/i18n/locales.go @@ -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