Browse Source

loadLanguages doesn't need to be exported

Piotr Czajkowski 3 years ago
parent
commit
39ce35e0cb
3 changed files with 4 additions and 5 deletions
  1. 2 3
      app.go
  2. 1 1
      app_test.go
  3. 1 1
      server.go

+ 2 - 3
app.go

@@ -33,11 +33,10 @@ func jsonDecoder(data io.ReadCloser, target interface{}) {
 	}
 }
 
-// LoadLanguages loads languages from languages.json to map.
-func (app *Application) LoadLanguages() {
+func (app *Application) loadLanguages() {
 	data, err := os.Open("./html/languages.json")
 	if err != nil {
-		log.Fatalf("Error reading languages: %v", err)
+		log.Fatalf("Error reading languages: %s", err)
 	}
 	defer data.Close()
 

+ 1 - 1
app_test.go

@@ -20,7 +20,7 @@ func TestSetBaseURL(t *testing.T) {
 
 func TestLoadLanguages(t *testing.T) {
 	var app Application
-	app.LoadLanguages()
+	app.loadLanguages()
 
 	testLanguageCode := "dan"
 	testLanguage := "Danish"

+ 1 - 1
server.go

@@ -78,7 +78,7 @@ func main() {
 	}
 
 	app.Login()
-	app.LoadLanguages()
+	app.loadLanguages()
 	app.Delay = time.Duration(20 * time.Second)
 
 	hostname := *host + ":" + *port