pushbullet.go
func (c *Client) Push(endPoint string, data interface{}) error {
	req := c.buildRequest(endPoint, data)
	resp, err := c.Client.Do(req)
	if err != nil {
		return err
	}
	defer resp.Body.Close()

	if resp.StatusCode != http.StatusOK {
		var errResponse errorResponse
		dec := json.NewDecoder(resp.Body)
		err = dec.Decode(&errResponse)
		if err == nil {
			return &errResponse.ErrResponse
		}

		return errors.New(resp.Status)
	}

	return nil
}
func (c *Client) Push(endPoint string, data interface{}) error {
	req := c.buildRequest(endPoint, data)
	resp, err := c.Client.Do(req)
	if err != nil {
		return err
	}
	defer resp.Body.Close()

	if resp.StatusCode != http.StatusOK {
		var errResponse errorResponse
		dec := json.NewDecoder(resp.Body)
		err = dec.Decode(&errResponse)
		if err == nil {
			return &errResponse.ErrResponse
		}

		return errors.New(resp.Status)
	}

	return nil
}
func ( c * Client ) Push ( endPoint string , data interface { } ) error { req := c . buildRequest ( endPoint , data ) resp , err := c . Client . Do ( req ) if err != nil { return err } defer resp . Body . Close ( ) if resp . StatusCode != http . StatusOK { var errResponse errorResponse dec := json . NewDecoder ( resp . Body ) err = dec . Decode ( & errResponse ) if err == nil { return & errResponse . ErrResponse } return errors . New ( resp . Status ) } return nil }
// Push pushes the data to a specific device registered with PushBullet.  The
// 'data' parameter is marshaled to JSON and sent as the request body.  Most
// users should call one of PusNote, PushLink, PushAddress, or PushList.
Push pushes the data to a specific device registered with PushBullet . The data parameter is marshaled to JSON and sent as the request body . Most users should call one of PusNote PushLink PushAddress or PushList .