From 9f0a63ee86d9f977207f58842db3e11874f9b48b Mon Sep 17 00:00:00 2001 From: Matt Baer Date: Mon, 8 Oct 2018 20:15:30 -0400 Subject: [PATCH] Add Version constant --- writeas.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/writeas.go b/writeas.go index a31b636..0b4e840 100644 --- a/writeas.go +++ b/writeas.go @@ -16,6 +16,9 @@ const ( apiURL = "https://write.as/api" devAPIURL = "https://development.write.as/api" torAPIURL = "http://writeas7pm7rcdqg.onion/api" + + // Current go-writeas version + Version = "2-dev" ) // Client is used to interact with the Write.as API. It can be used to make @@ -161,7 +164,7 @@ func (c *Client) doRequest(r *http.Request, result interface{}) (*impart.Envelop func (c *Client) prepareRequest(r *http.Request) { ua := c.UserAgent if ua == "" { - ua = "go-writeas v1" + ua = "go-writeas v" + Version } r.Header.Add("User-Agent", ua) r.Header.Add("Content-Type", "application/json")