{"action":"created","issue":{"url":"https://api.github.com/repos/golang/go/issues/13623","labels_url":"https://api.github.com/repos/golang/go/issues/13623/labels{/name}","comments_url":"https://api.github.com/repos/golang/go/issues/13623/comments","events_url":"https://api.github.com/repos/golang/go/issues/13623/events","html_url":"https://github.com/golang/go/issues/13623","id":122184133,"number":13623,"title":"net: a nsswitch.conf hosts: entry with 'myhostname' forces cgo lookups for LookupPort() and others","user":{"login":"siebenmann","id":865382,"avatar_url":"https://avatars.githubusercontent.com/u/865382?v=3","gravatar_id":"","url":"https://api.github.com/users/siebenmann","html_url":"https://github.com/siebenmann","followers_url":"https://api.github.com/users/siebenmann/followers","following_url":"https://api.github.com/users/siebenmann/following{/other_user}","gists_url":"https://api.github.com/users/siebenmann/gists{/gist_id}","starred_url":"https://api.github.com/users/siebenmann/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/siebenmann/subscriptions","organizations_url":"https://api.github.com/users/siebenmann/orgs","repos_url":"https://api.github.com/users/siebenmann/repos","events_url":"https://api.github.com/users/siebenmann/events{/privacy}","received_events_url":"https://api.github.com/users/siebenmann/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-12-15T03:16:21Z","updated_at":"2015-12-15T05:09:13Z","closed_at":null,"body":"net.LookupPort(), net.LookupCNAME(), and net.LookupAddr() all wind up trying to decide whether to use cgo lookups or the pure Go lookups by calling hostLookupOrder(\"\") (via canUseCgo()). Because the empty string contains no dots, it matches the 'nsswitch.conf hosts line contains myhostname and hostname to be looked up contains no dots' check that forces the use of cgo. I suspect that this is unintentional, as at least the port lookup isn't a hostname related one and so won't actually use the myhostname NSS module.\r\n\r\n(It may be necessary for LookupCNAME() to care about myhostname here, unlike at least port lookup.)"},"comment":{"url":"https://api.github.com/repos/golang/go/issues/comments/164646319","html_url":"https://github.com/golang/go/issues/13623#issuecomment-164646319","issue_url":"https://api.github.com/repos/golang/go/issues/13623","id":164646319,"user":{"login":"bradfitz","id":2621,"avatar_url":"https://avatars.githubusercontent.com/u/2621?v=3","gravatar_id":"","url":"https://api.github.com/users/bradfitz","html_url":"https://github.com/bradfitz","followers_url":"https://api.github.com/users/bradfitz/followers","following_url":"https://api.github.com/users/bradfitz/following{/other_user}","gists_url":"https://api.github.com/users/bradfitz/gists{/gist_id}","starred_url":"https://api.github.com/users/bradfitz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bradfitz/subscriptions","organizations_url":"https://api.github.com/users/bradfitz/orgs","repos_url":"https://api.github.com/users/bradfitz/repos","events_url":"https://api.github.com/users/bradfitz/events{/privacy}","received_events_url":"https://api.github.com/users/bradfitz/received_events","type":"User","site_admin":false},"created_at":"2015-12-15T05:09:13Z","updated_at":"2015-12-15T05:09:13Z","body":"Do you call LookupPort enough to matter either way?\r\n"}}