func (c *Client) Device(nickname string) (*Device, error) {
	devices, err := c.Devices()
	if err != nil {
		return nil, err
	}

	for i := range devices {
		if devices[i].Nickname == nickname {
			devices[i].Client = c
			return devices[i], nil
		}
	}
	return nil, ErrDeviceNotFound
}
func (c *Client) Device(nickname string) (*Device, error) {
	devices, err := c.Devices()
	if err != nil {
		return nil, err
	}

	for i := range devices {
		if devices[i].Nickname == nickname {
			devices[i].Client = c
			return devices[i], nil
		}
	}
	return nil, ErrDeviceNotFound
}
func ( c * Client ) Device ( nickname string ) ( * Device , error ) { devices , err := c . Devices ( ) if err != nil { return nil , err } for i := range devices { if devices [ i ] . Nickname == nickname { devices [ i ] . Client = c return devices [ i ] , nil } } return nil , ErrDeviceNotFound }
// Device fetches an device with a given nickname from PushBullet.
Device fetches an device with a given nickname from PushBullet .