Browse Source

Add Version constant

pull/9/head
Matt Baer 5 years ago
parent
commit
9f0a63ee86
1 changed files with 4 additions and 1 deletions
  1. +4
    -1
      writeas.go

+ 4
- 1
writeas.go View File

@@ -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")


Loading…
Cancel
Save