瀏覽代碼

login doesn't need to be exported

Piotr Czajkowski 3 年之前
父節點
當前提交
a2cb341aa0
共有 4 個文件被更改,包括 4 次插入5 次删除
  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)
 	}