BaseURL must be specified as base_URL in the TOML file.
Fix tests.
(sometimes I hate such rules for auto-seialization)
--- a/config.go Tue Apr 11 17:04:40 2017 +0200
+++ b/config.go Tue Apr 11 17:15:12 2017 +0200
@@ -33,10 +33,10 @@
// Config holds our parameters
type Server struct {
- ID string
- Name string
- BearerToken string
- BaseURL string // This allow for overriding the APIEndpoint on registration
+ ID string `json:"id"`
+ Name string `json:"name"`
+ BearerToken string `json:"bearer_token"`
+ BaseURL string `json:"base_url"` // Allow for overriding APIEndpoint on registration
}
type Config struct {
--- a/gondole_test.go Tue Apr 11 17:04:40 2017 +0200
+++ b/gondole_test.go Tue Apr 11 17:15:12 2017 +0200
@@ -6,7 +6,7 @@
)
func TestPrepareRequest(t *testing.T) {
- g, err := NewApp("foo", nil, NoRedirect)
+ g, err := NewApp("foo", nil, NoRedirect, "")
assert.NoError(t, err, "no error")
req := g.prepareRequest("bar")
--- a/test/config.toml Tue Apr 11 17:04:40 2017 +0200
+++ b/test/config.toml Tue Apr 11 17:15:12 2017 +0200
@@ -1,1 +1,1 @@
-default = "foo"
+default="foo"
--- a/test/foo.token Tue Apr 11 17:04:40 2017 +0200
+++ b/test/foo.token Tue Apr 11 17:15:12 2017 +0200
@@ -1,4 +1,4 @@
id = "666"
name = "foo"
bearer_token = "d3b07384d113edec49eaa6238ad5ff00"
-baseurl = "https://mastodon.social"
\ No newline at end of file
+base_URL = "https://mastodon.social"
\ No newline at end of file