Browse Source

Use fmt.Errorf instead of errors.New(...)

pull/6/head
Matt Baer 6 years ago
parent
commit
d69be33765
1 changed files with 1 additions and 2 deletions
  1. +1
    -2
      writeas.go

+ 1
- 2
writeas.go View File

@@ -4,7 +4,6 @@ package writeas
import (
"bytes"
"encoding/json"
"errors"
"fmt"
"github.com/writeas/impart"
"io"
@@ -51,7 +50,7 @@ func (c *Client) SetToken(token string) {
func (c *Client) get(path string, r interface{}) (*impart.Envelope, error) {
method := "GET"
if method != "GET" && method != "HEAD" {
return nil, errors.New(fmt.Sprintf("Method %s not currently supported by library (only HEAD and GET).\n", method))
return nil, fmt.Errorf("Method %s not currently supported by library (only HEAD and GET).\n", method)
}

return c.request(method, path, nil, r)


Loading…
Cancel
Save