瀏覽代碼

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

pull/6/head
Matt Baer 6 年之前
父節點
當前提交
d69be33765
共有 1 個檔案被更改,包括 1 行新增2 行删除
  1. +1
    -2
      writeas.go

+ 1
- 2
writeas.go 查看文件

@@ -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…
取消
儲存