{"action":"opened","issue":{"url":"https://api.github.com/repos/jhoonb/archivex/issues/23","repository_url":"https://api.github.com/repos/jhoonb/archivex","labels_url":"https://api.github.com/repos/jhoonb/archivex/issues/23/labels{/name}","comments_url":"https://api.github.com/repos/jhoonb/archivex/issues/23/comments","events_url":"https://api.github.com/repos/jhoonb/archivex/issues/23/events","html_url":"https://github.com/jhoonb/archivex/issues/23","id":189715906,"number":23,"title":"Query regarding logic","user":{"login":"jeremyquinton","id":1847770,"avatar_url":"https://avatars.githubusercontent.com/u/1847770?v=3","gravatar_id":"","url":"https://api.github.com/users/jeremyquinton","html_url":"https://github.com/jeremyquinton","followers_url":"https://api.github.com/users/jeremyquinton/followers","following_url":"https://api.github.com/users/jeremyquinton/following{/other_user}","gists_url":"https://api.github.com/users/jeremyquinton/gists{/gist_id}","starred_url":"https://api.github.com/users/jeremyquinton/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jeremyquinton/subscriptions","organizations_url":"https://api.github.com/users/jeremyquinton/orgs","repos_url":"https://api.github.com/users/jeremyquinton/repos","events_url":"https://api.github.com/users/jeremyquinton/events{/privacy}","received_events_url":"https://api.github.com/users/jeremyquinton/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-11-16T14:14:14Z","updated_at":"2016-11-16T14:14:14Z","closed_at":null,"body":"This is a great little library found it really useful. I was just reading the source and Im new to go I had a thought around these lines thought maybe worth mentioning. \r\n\r\nhttps://github.com/jhoonb/archivex/blob/master/archivex.go#L53-L60\r\n```\r\n\tif strings.HasSuffix(name, \".zip\") != true {\r\n\t\tif strings.HasSuffix(name, \".tar.gz\") == true {\r\n\t\t\tname = strings.Replace(name, \".tar.gz\", \".zip\", -1)\r\n\t\t} else {\r\n\t\t\tname = name + \".zip\"\r\n\t\t}\r\n\t}\r\n\tz.Name = name\r\n```\r\ncould it not be better written as\r\n\r\n```\r\n\tif strings.HasSuffix(name, \".zip\") == true {\r\n\t\tz.Name = name\r\n\t}\r\n\r\n\tif strings.HasSuffix(name, \".tar.gz\") == true {\r\n\t\tz.Name = strings.Replace(name, \".tar.gz\", \".zip\", -1)\r\n\t}\r\n\r\n\tif z.Name == \"\" {\r\n\t\tz.Name = name + \".zip\"\r\n\t}\r\n```\r\n\r\nthe idea being that code with one level of indentation is easier to read. If you think that is an improvement Id be happy to do a PR else you can close my issue. Thanks again for the library works really well. \r\n\r\n\r\n"}}
{"actor":{"display_login":"jeremyquinton"}}