Is Youtube V3 IfNoneMatch is a no-op?

6 days ago 9
ARTICLE AD BOX

Considering the following code, I expect the call to return an error when the Etag that is provided is the same as the remote one.
But when testing it does not really matter if it match or not.

func (f *getFacade) callVideoList() (*youtube.VideoListResponse, error) { call := f.service.Videos.List([]string{"snippet", "status"}) call.Id(f.video.GoogleID).IfNoneMatch(f.video.GoogleEtag) return call.Do() }

The inner doc say:

// IfNoneMatch sets an optional parameter which makes the operation fail if the // object's ETag matches the given value. This is useful for getting updates // only after the object has changed since the last request. func (c *VideosListCall) IfNoneMatch(entityTag string) *VideosListCall { c.ifNoneMatch_ = entityTag return c }

So its a no-op or I did something wrong?

Read Entire Article