{"action":"created","issue":{"url":"https://api.github.com/repos/fatih/structs/issues/38","labels_url":"https://api.github.com/repos/fatih/structs/issues/38/labels{/name}","comments_url":"https://api.github.com/repos/fatih/structs/issues/38/comments","events_url":"https://api.github.com/repos/fatih/structs/issues/38/events","html_url":"https://github.com/fatih/structs/pull/38","id":118135261,"number":38,"title":"add Zero function to field","user":{"login":"mammothbane","id":1946010,"avatar_url":"https://avatars.githubusercontent.com/u/1946010?v=3","gravatar_id":"","url":"https://api.github.com/users/mammothbane","html_url":"https://github.com/mammothbane","followers_url":"https://api.github.com/users/mammothbane/followers","following_url":"https://api.github.com/users/mammothbane/following{/other_user}","gists_url":"https://api.github.com/users/mammothbane/gists{/gist_id}","starred_url":"https://api.github.com/users/mammothbane/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mammothbane/subscriptions","organizations_url":"https://api.github.com/users/mammothbane/orgs","repos_url":"https://api.github.com/users/mammothbane/repos","events_url":"https://api.github.com/users/mammothbane/events{/privacy}","received_events_url":"https://api.github.com/users/mammothbane/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-11-20T22:01:09Z","updated_at":"2015-11-21T17:42:54Z","closed_at":"2015-11-21T17:42:47Z","pull_request":{"url":"https://api.github.com/repos/fatih/structs/pulls/38","html_url":"https://github.com/fatih/structs/pull/38","diff_url":"https://github.com/fatih/structs/pull/38.diff","patch_url":"https://github.com/fatih/structs/pull/38.patch"},"body":"I have a few testing functions that check that my struct validation logic errors when certain fields are zeroed, and I wanted to DRY up this process. I'm looking to write a helper that takes a field name, zeroes that field, and ensures that it fails to validate. However, I can't use `Set` because `Field.value` is internal, so I can't pass `reflect.Zero(f.value.Type()).Interface()` to it. \r\n\r\nAs a result, I wrote `Zero`, which does just that. Tests are adapted directly from `Set`."},"comment":{"url":"https://api.github.com/repos/fatih/structs/issues/comments/158664679","html_url":"https://github.com/fatih/structs/pull/38#issuecomment-158664679","issue_url":"https://api.github.com/repos/fatih/structs/issues/38","id":158664679,"user":{"login":"fatih","id":438920,"avatar_url":"https://avatars.githubusercontent.com/u/438920?v=3","gravatar_id":"","url":"https://api.github.com/users/fatih","html_url":"https://github.com/fatih","followers_url":"https://api.github.com/users/fatih/followers","following_url":"https://api.github.com/users/fatih/following{/other_user}","gists_url":"https://api.github.com/users/fatih/gists{/gist_id}","starred_url":"https://api.github.com/users/fatih/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fatih/subscriptions","organizations_url":"https://api.github.com/users/fatih/orgs","repos_url":"https://api.github.com/users/fatih/repos","events_url":"https://api.github.com/users/fatih/events{/privacy}","received_events_url":"https://api.github.com/users/fatih/received_events","type":"User","site_admin":false},"created_at":"2015-11-21T17:42:54Z","updated_at":"2015-11-21T17:42:54Z","body":"LGTM. Thanks @mammothbane "}}