{"action":"opened","issue":{"url":"https://api.github.com/repos/iamduo/workq/issues/8","repository_url":"https://api.github.com/repos/iamduo/workq","labels_url":"https://api.github.com/repos/iamduo/workq/issues/8/labels{/name}","comments_url":"https://api.github.com/repos/iamduo/workq/issues/8/comments","events_url":"https://api.github.com/repos/iamduo/workq/issues/8/events","html_url":"https://github.com/iamduo/workq/issues/8","id":172852745,"number":8,"title":"ActiveClients counting in server.go","user":{"login":"danny-su","id":12178855,"avatar_url":"https://avatars.githubusercontent.com/u/12178855?v=3","gravatar_id":"","url":"https://api.github.com/users/danny-su","html_url":"https://github.com/danny-su","followers_url":"https://api.github.com/users/danny-su/followers","following_url":"https://api.github.com/users/danny-su/following{/other_user}","gists_url":"https://api.github.com/users/danny-su/gists{/gist_id}","starred_url":"https://api.github.com/users/danny-su/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/danny-su/subscriptions","organizations_url":"https://api.github.com/users/danny-su/orgs","repos_url":"https://api.github.com/users/danny-su/repos","events_url":"https://api.github.com/users/danny-su/events{/privacy}","received_events_url":"https://api.github.com/users/danny-su/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-08-24T02:48:52Z","updated_at":"2016-08-24T02:48:52Z","closed_at":null,"body":"```\r\nfunc (s *Server) clientLoop(c *client.Client) {\r\n\tatomic.AddUint64(&s.Usage.ActiveClients, 1)\r\n\tdefer atomic.AddUint64(&s.Usage.ActiveClients, ^uint64(1))\r\n```\r\nThe second line is incrementing ActiveClients by 1, but the third line is decrementing ActiveClients by 2 when leaving clientLoop method. Is that correct, or I missed something?\r\nI think the following code is the right one:\r\n`defer atomic.AddUint64(&s.Usage.ActiveClients, ^uint64(0))`\r\n\r\n"}}
{"actor":{"display_login":"danny-su"}}