Browse Source

login doesn't need to be exported

Piotr Czajkowski 3 years ago
parent
commit
a2cb341aa0
4 changed files with 4 additions and 5 deletions
  1. 1 2
      app.go
  2. 1 1
      search.go
  3. 1 1
      server.go
  4. 1 1
      tm.go

+ 1 - 2
app.go

@@ -49,8 +49,7 @@ func (app Application) checkLanguage(language string) bool {
 	return ok
 }
 
-// Login logs into the API and sets AuthString.
-func (app *Application) Login() {
+func (app *Application) login() {
 	credentials, err := ioutil.ReadFile("./secrets.json")
 	if err != nil {
 		log.Fatalf("Error reading credentials: %v", err)

+ 1 - 1
search.go

@@ -109,7 +109,7 @@ func (app *Application) Search(TMs []TM, text string) SearchResults {
 
 		if resp.StatusCode == 401 {
 			time.Sleep(app.Delay)
-			app.Login()
+			app.login()
 			return app.Search(TMs, text)
 		}
 

+ 1 - 1
server.go

@@ -77,7 +77,7 @@ func main() {
 		log.Fatalln("Can't do anything without URL to API")
 	}
 
-	app.Login()
+	app.login()
 	app.loadLanguages()
 	app.Delay = time.Duration(20 * time.Second)
 

+ 1 - 1
tm.go

@@ -36,7 +36,7 @@ func (app *Application) GetTMs(language string) []TM {
 	defer resp.Body.Close()
 	if resp.StatusCode == 401 {
 		time.Sleep(app.Delay)
-		app.Login()
+		app.login()
 		return app.GetTMs(language)
 	}