{"action":"created","issue":{"url":"https://api.github.com/repos/rivo/tview/issues/175","repository_url":"https://api.github.com/repos/rivo/tview","labels_url":"https://api.github.com/repos/rivo/tview/issues/175/labels{/name}","comments_url":"https://api.github.com/repos/rivo/tview/issues/175/comments","events_url":"https://api.github.com/repos/rivo/tview/issues/175/events","html_url":"https://github.com/rivo/tview/pull/175","id":374684765,"node_id":"MDExOlB1bGxSZXF1ZXN0MjI2MzIxMDQ3","number":175,"title":"Do not duplicate dropdown option entry if it already exists","user":{"login":"joakim-ribier","id":1481969,"node_id":"MDQ6VXNlcjE0ODE5Njk=","avatar_url":"https://avatars0.githubusercontent.com/u/1481969?v=4","gravatar_id":"","url":"https://api.github.com/users/joakim-ribier","html_url":"https://github.com/joakim-ribier","followers_url":"https://api.github.com/users/joakim-ribier/followers","following_url":"https://api.github.com/users/joakim-ribier/following{/other_user}","gists_url":"https://api.github.com/users/joakim-ribier/gists{/gist_id}","starred_url":"https://api.github.com/users/joakim-ribier/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/joakim-ribier/subscriptions","organizations_url":"https://api.github.com/users/joakim-ribier/orgs","repos_url":"https://api.github.com/users/joakim-ribier/repos","events_url":"https://api.github.com/users/joakim-ribier/events{/privacy}","received_events_url":"https://api.github.com/users/joakim-ribier/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2018-10-27T20:20:23Z","updated_at":"2018-11-12T13:32:37Z","closed_at":"2018-11-12T13:32:37Z","author_association":"NONE","pull_request":{"url":"https://api.github.com/repos/rivo/tview/pulls/175","html_url":"https://github.com/rivo/tview/pull/175","diff_url":"https://github.com/rivo/tview/pull/175.diff","patch_url":"https://github.com/rivo/tview/pull/175.patch"},"body":"Hi,\r\n\r\nI propose this little fix (feature) for to not add a duplicate entry to a dropdown widget if the text already exists.\r\n\r\nSorry for advance, i don't know if this is the right way to proceed...\r\n\r\nThanks"},"comment":{"url":"https://api.github.com/repos/rivo/tview/issues/comments/437881143","html_url":"https://github.com/rivo/tview/pull/175#issuecomment-437881143","issue_url":"https://api.github.com/repos/rivo/tview/issues/175","id":437881143,"node_id":"MDEyOklzc3VlQ29tbWVudDQzNzg4MTE0Mw==","user":{"login":"rivo","id":480930,"node_id":"MDQ6VXNlcjQ4MDkzMA==","avatar_url":"https://avatars0.githubusercontent.com/u/480930?v=4","gravatar_id":"","url":"https://api.github.com/users/rivo","html_url":"https://github.com/rivo","followers_url":"https://api.github.com/users/rivo/followers","following_url":"https://api.github.com/users/rivo/following{/other_user}","gists_url":"https://api.github.com/users/rivo/gists{/gist_id}","starred_url":"https://api.github.com/users/rivo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rivo/subscriptions","organizations_url":"https://api.github.com/users/rivo/orgs","repos_url":"https://api.github.com/users/rivo/repos","events_url":"https://api.github.com/users/rivo/events{/privacy}","received_events_url":"https://api.github.com/users/rivo/received_events","type":"User","site_admin":false},"created_at":"2018-11-12T13:32:37Z","updated_at":"2018-11-12T13:32:37Z","author_association":"OWNER","body":"I would actually agree with you here that this functionality should be part of your application rather than the `tview` package. You could have a set like this:\r\n\r\n```go\r\nset := make(map[string]struct{})\r\n```\r\n\r\nThen you also add your entry to this set: `set[option] = struct{}{}`. To test if an entry already exists, do this: `_, exists := set[option]`. If `exists == true`, you don't add your entry.\r\n\r\nI'll close this PR now. If you have any more questions, feel free to post them here. I read them."}}
{"actor":{"display_login":"rivo"}}