{"action":"created","issue":{"url":"https://api.github.com/repos/dominikh/go-tools/issues/578","repository_url":"https://api.github.com/repos/dominikh/go-tools","labels_url":"https://api.github.com/repos/dominikh/go-tools/issues/578/labels{/name}","comments_url":"https://api.github.com/repos/dominikh/go-tools/issues/578/comments","events_url":"https://api.github.com/repos/dominikh/go-tools/issues/578/events","html_url":"https://github.com/dominikh/go-tools/issues/578","id":490389321,"node_id":"MDU6SXNzdWU0OTAzODkzMjE=","number":578,"title":"staticcheck: cgo and intermittent false reporting","user":{"login":"tendervittles","id":5739852,"node_id":"MDQ6VXNlcjU3Mzk4NTI=","avatar_url":"https://avatars2.githubusercontent.com/u/5739852?v=4","gravatar_id":"","url":"https://api.github.com/users/tendervittles","html_url":"https://github.com/tendervittles","followers_url":"https://api.github.com/users/tendervittles/followers","following_url":"https://api.github.com/users/tendervittles/following{/other_user}","gists_url":"https://api.github.com/users/tendervittles/gists{/gist_id}","starred_url":"https://api.github.com/users/tendervittles/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tendervittles/subscriptions","organizations_url":"https://api.github.com/users/tendervittles/orgs","repos_url":"https://api.github.com/users/tendervittles/repos","events_url":"https://api.github.com/users/tendervittles/events{/privacy}","received_events_url":"https://api.github.com/users/tendervittles/received_events","type":"User","site_admin":false},"labels":[{"id":525281741,"node_id":"MDU6TGFiZWw1MjUyODE3NDE=","url":"https://api.github.com/repos/dominikh/go-tools/labels/bug","name":"bug","color":"ee0701","default":true},{"id":527910756,"node_id":"MDU6TGFiZWw1Mjc5MTA3NTY=","url":"https://api.github.com/repos/dominikh/go-tools/labels/waiting-for-feedback","name":"waiting-for-feedback","color":"c5def5","default":false}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2019-09-06T15:28:55Z","updated_at":"2019-10-21T22:41:00Z","closed_at":"2019-10-21T22:41:00Z","author_association":"NONE","body":"<!--\r\nPlease make sure to include the following information in your issue report:\r\n\r\n- The output of 'staticcheck -version'\r\n- The output of 'staticcheck -debug.version' (it is fine if this command fails)\r\n- The output of 'go version'\r\n- The output of 'go env'\r\n- Exactly which command you ran\r\n- Output of the command and what's wrong with the output\r\n- Where we can read the code you're running staticcheck on\r\n  (GitHub repo, link to playground, code embedded in the issue, ...)\r\n-->\r\n\r\n```\r\n$ staticcheck -debug.version\r\nstaticcheck 2019.2.2\r\n\r\nCompiled with Go version: go1.13\r\nMain module:\r\n\thonnef.co/go/tools@v0.0.1-2019.2.2 (sum: h1:TEgegKbBqByGUb1Coo1pc2qIdf2xw6v0mYyLSYtyopE=)\r\nDependencies:\r\n\tgithub.com/BurntSushi/toml@v0.3.1 (sum: h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ=)\r\n\tgolang.org/x/tools@v0.0.0-20190621195816-6e04913cbbac (sum: h1:MQEvx39qSf8vyrx3XRaOe+j1UDIzKwkYOVObRgGPVqI=)\r\n```\r\n\r\n```\r\nGO111MODULE=\"\"\r\nGOARCH=\"amd64\"\r\nGOBIN=\"\"\r\nGOCACHE=\"/home/tendervittles/.cache/go-build\"\r\nGOENV=\"/home/tendervittles/.config/go/env\"\r\nGOEXE=\"\"\r\nGOFLAGS=\"\"\r\nGOHOSTARCH=\"amd64\"\r\nGOHOSTOS=\"linux\"\r\nGONOPROXY=\"\"\r\nGONOSUMDB=\"\"\r\nGOOS=\"linux\"\r\nGOPATH=\"/home/tendervittles/go\"\r\nGOPRIVATE=\"\"\r\nGOPROXY=\"https://proxy.golang.org,direct\"\r\nGOROOT=\"/usr/local/go\"\r\nGOSUMDB=\"sum.golang.org\"\r\nGOTMPDIR=\"\"\r\nGOTOOLDIR=\"/usr/local/go/pkg/tool/linux_amd64\"\r\nGCCGO=\"gccgo\"\r\nAR=\"ar\"\r\nCC=\"gcc\"\r\nCXX=\"g++\"\r\nCGO_ENABLED=\"1\"\r\nGOMOD=\"\"\r\nCGO_CFLAGS=\"-g -O2\"\r\nCGO_CPPFLAGS=\"\"\r\nCGO_CXXFLAGS=\"-g -O2\"\r\nCGO_FFLAGS=\"-g -O2\"\r\nCGO_LDFLAGS=\"-g -O2\"\r\nPKG_CONFIG=\"pkg-config\"\r\nGOGCCFLAGS=\"-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build018615117=/tmp/go-build -gno-record-gcc-switches\"\r\n```\r\n\r\n```\r\n$ cat staticcheck.conf\r\n# staticcheck 2019.2.2\r\n\r\nchecks = [\"all\",\r\n    \"-S1002\",  # Omit comparison with boolean constant\r\n    \"-ST1000\", # Incorrect or missing package comment\r\n    \"-ST1003\", # Poorly chosen identifier\r\n    \"-ST1005\", # Incorrectly formatted error string\r\n    \"-ST1006\", # Poorly chosen receiver name\r\n    \"-ST1016\", # Use consistent method receiver names\r\n    \"-ST1017\", # Don't use Yoda conditions\r\n    \"-U1000\",  # Unused code\r\n]\r\n```\r\n\r\nI run `staticcheck ./...` on my repo with the above conf.\r\n\r\nAfter I began building staticcheck 2019.2.2 with go1.13, I started to get an intermittent warning on `ST1005`, which I'm ignoring.\r\n\r\nIt only happens in one spot, where the preceding and following lines are both cgo statements. I wasn't able to reproducible consistently, but I did intermittently see it on multiple hosts.\r\n\r\nI've fixed the error string, but that behavior is strange."},"comment":{"url":"https://api.github.com/repos/dominikh/go-tools/issues/comments/544738247","html_url":"https://github.com/dominikh/go-tools/issues/578#issuecomment-544738247","issue_url":"https://api.github.com/repos/dominikh/go-tools/issues/578","id":544738247,"node_id":"MDEyOklzc3VlQ29tbWVudDU0NDczODI0Nw==","user":{"login":"tendervittles","id":5739852,"node_id":"MDQ6VXNlcjU3Mzk4NTI=","avatar_url":"https://avatars2.githubusercontent.com/u/5739852?v=4","gravatar_id":"","url":"https://api.github.com/users/tendervittles","html_url":"https://github.com/tendervittles","followers_url":"https://api.github.com/users/tendervittles/followers","following_url":"https://api.github.com/users/tendervittles/following{/other_user}","gists_url":"https://api.github.com/users/tendervittles/gists{/gist_id}","starred_url":"https://api.github.com/users/tendervittles/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tendervittles/subscriptions","organizations_url":"https://api.github.com/users/tendervittles/orgs","repos_url":"https://api.github.com/users/tendervittles/repos","events_url":"https://api.github.com/users/tendervittles/events{/privacy}","received_events_url":"https://api.github.com/users/tendervittles/received_events","type":"User","site_admin":false},"created_at":"2019-10-21T22:41:00Z","updated_at":"2019-10-21T22:41:00Z","author_association":"NONE","body":"@dominikh,\r\n\r\nUnfortunately, I couldn't find a reproducer. "}}
{"actor":{"display_login":"tendervittles"}}