Browse Source

Doesn't need to be exported

Piotr Czajkowski 3 years ago
parent
commit
134184bf45
5 changed files with 6 additions and 7 deletions
  1. 1 2
      app.go
  2. 2 2
      app_test.go
  3. 1 1
      search_test.go
  4. 1 1
      server.go
  5. 1 1
      tm_test.go

+ 1 - 2
app.go

@@ -17,8 +17,7 @@ type Application struct {
 	Delay                                       time.Duration
 }
 
-// SetBaseURL sets base URL for API endpoint.
-func (app *Application) SetBaseURL(url string) {
+func (app *Application) setBaseURL(url string) {
 	if !strings.HasSuffix(url, "/") {
 		url += "/"
 	}

+ 2 - 2
app_test.go

@@ -11,14 +11,14 @@ func TestSetBaseURL(t *testing.T) {
 
 	t.Log("Testing if mandatory slash is added to the end of BaseURL.")
 	var app Application
-	app.SetBaseURL(urlWithSlash)
+	app.setBaseURL(urlWithSlash)
 	if strings.HasSuffix(app.BaseURL, "//") {
 		t.Errorf("URL has been malformed: %v", app.BaseURL)
 	} else {
 		t.Log("URL with slash was set correctly!")
 	}
 
-	app.SetBaseURL(urlWithoutSlash)
+	app.setBaseURL(urlWithoutSlash)
 	if !strings.HasSuffix(app.BaseURL, "/") {
 		t.Errorf("URL has been malformed: %v", app.BaseURL)
 	} else {

+ 1 - 1
search_test.go

@@ -48,7 +48,7 @@ func TestSearch(t *testing.T) {
 	defer server.Close()
 
 	var app Application
-	app.SetBaseURL(server.URL)
+	app.setBaseURL(server.URL)
 
 	tmsJSON, err := os.Open("./testFiles/tms.json")
 	if err != nil {

+ 1 - 1
server.go

@@ -72,7 +72,7 @@ func displayTMs(w http.ResponseWriter, r *http.Request) {
 
 func main() {
 	flag.Parse()
-	app.SetBaseURL(*url)
+	app.setBaseURL(*url)
 	if app.BaseURL == "" {
 		log.Fatalln("Can't do anything without URL to API")
 	}

+ 1 - 1
tm_test.go

@@ -29,7 +29,7 @@ func TestGetTMs(t *testing.T) {
 	defer server.Close()
 
 	var app Application
-	app.SetBaseURL(server.URL)
+	app.setBaseURL(server.URL)
 
 	t.Log("Testing if TMs are properly read from the server.")
 	tms := app.GetTMs("")