{"action":"created","issue":{"url":"https://api.github.com/repos/golangci/golangci-lint/issues/307","repository_url":"https://api.github.com/repos/golangci/golangci-lint","labels_url":"https://api.github.com/repos/golangci/golangci-lint/issues/307/labels{/name}","comments_url":"https://api.github.com/repos/golangci/golangci-lint/issues/307/comments","events_url":"https://api.github.com/repos/golangci/golangci-lint/issues/307/events","html_url":"https://github.com/golangci/golangci-lint/issues/307","id":384451146,"node_id":"MDU6SXNzdWUzODQ0NTExNDY=","number":307,"title":"Can't extract issues from gofmt output on windows","user":{"login":"crsdrw","id":811010,"node_id":"MDQ6VXNlcjgxMTAxMA==","avatar_url":"https://avatars3.githubusercontent.com/u/811010?v=4","gravatar_id":"","url":"https://api.github.com/users/crsdrw","html_url":"https://github.com/crsdrw","followers_url":"https://api.github.com/users/crsdrw/followers","following_url":"https://api.github.com/users/crsdrw/following{/other_user}","gists_url":"https://api.github.com/users/crsdrw/gists{/gist_id}","starred_url":"https://api.github.com/users/crsdrw/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/crsdrw/subscriptions","organizations_url":"https://api.github.com/users/crsdrw/orgs","repos_url":"https://api.github.com/users/crsdrw/repos","events_url":"https://api.github.com/users/crsdrw/events{/privacy}","received_events_url":"https://api.github.com/users/crsdrw/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":7,"created_at":"2018-11-26T18:14:53Z","updated_at":"2018-11-27T20:20:01Z","closed_at":null,"author_association":"NONE","body":"I'm trying to run golangci-lint with the gofmt linter enabled on windows:\r\n```\r\ngolangci-lint run -E gofmt\r\n```\r\n\r\nAnd get the following error:\r\n```\r\nlevel=warning msg=\"[runner] Can't run linter gofmt: can't extract issues from gofmt diff output \\\"--- G:/dev/linttest/main.go.or\r\nig\\\\t2018-11-26 18:07:15.209770400 +0000\\\\r\\\\n+++ G:/dev/linttest/main.go\\\\t2018-11-26 18:07:15.210770400 +0000\\\\r\\\\n@@ -2,8 +2,\r\n8 @@\\\\r\\\\n \\\\r\\\\n import (\\\\r\\\\n \\\\t// goimports error - wrong order\\\\r\\\\n-\\\\t\\\\\\\"time\\\\\\\"\\\\r\\\\n \\\\t\\\\\\\"fmt\\\\\\\"\\\\r\\\\n+\\\\t\\\\\\\"tim\r\ne\\\\\\\"\\\\r\\\\n )\\\\r\\\\n \\\\r\\\\n func main() {\\\\r\\\\n\\\": can't parse patch: line 3, char 149: bad hunk header: @@ -2,8 +2,8 @@\\r\"\r\n```\r\n\r\nVerbose output:\r\n```\r\nlevel=warning msg=\"[runner] Can't run linter gofmt: can't extract issues from gofmt diff output \\\"--- G:/dev/linttest/main.go.or\r\nig\\\\t2018-11-26 18:07:15.209770400 +0000\\\\r\\\\n+++ G:/dev/linttest/main.go\\\\t2018-11-26 18:07:15.210770400 +0000\\\\r\\\\n@@ -2,8 +2,\r\n8 @@\\\\r\\\\n \\\\r\\\\n import (\\\\r\\\\n \\\\t// goimports error - wrong order\\\\r\\\\n-\\\\t\\\\\\\"time\\\\\\\"\\\\r\\\\n \\\\t\\\\\\\"fmt\\\\\\\"\\\\r\\\\n+\\\\t\\\\\\\"tim\r\ne\\\\\\\"\\\\r\\\\n )\\\\r\\\\n \\\\r\\\\n func main() {\\\\r\\\\n\\\": can't parse patch: line 3, char 149: bad hunk header: @@ -2,8 +2,8 @@\\r\"\r\n\r\nG:\\dev\\linttest>golangci-lint run -v -E gofmt\r\nlevel=info msg=\"[config_reader] Config search paths: [./ G:\\\\dev\\\\linttest G:\\\\dev G:\\\\]\"\r\nlevel=info msg=\"Gocritic enabled checks: [appendAssign assignOp caseOrder dupArg dupBranchBody dupCase flagDeref ifElseChain reg\r\nexpMust singleCaseSwitch sloppyLen switchTrue typeSwitchVar underef unlambda unslice defaultCaseOrder]\"\r\nlevel=info msg=\"[lintersdb] Active 9 linters: [deadcode errcheck gofmt govet ineffassign megacheck structcheck typecheck varchec\r\nk]\"\r\nlevel=info msg=\"[loader] Go packages loading at mode load deps types and syntax took 1.7967282s\"\r\nlevel=info msg=\"[loader] SSA repr building timing: packages building 12.5015ms, total 212.5269ms\"\r\nlevel=info msg=\"[loader] SSA for megacheck repr building timing: packages building 5.5007ms, total 178.5227ms\"\r\nlevel=info msg=\"[runner] worker.7 took 0s\"\r\nlevel=info msg=\"[runner] worker.12 took 0s\"\r\nlevel=info msg=\"[runner] worker.5 took 0s\"\r\nlevel=info msg=\"[runner] worker.13 took 0s\"\r\nlevel=info msg=\"[runner] worker.8 took 0s\"\r\nlevel=info msg=\"[runner] worker.4 took 500.1µs with stages: typecheck: 0s\"\r\nlevel=info msg=\"[runner] worker.11 took 0s\"\r\nlevel=info msg=\"[runner] worker.15 took 1.0002ms with stages: varcheck: 500.1µs\"\r\nlevel=info msg=\"[runner] worker.14 took 500.1µs with stages: structcheck: 500.1µs\"\r\nlevel=info msg=\"[runner] worker.9 took 0s\"\r\nlevel=info msg=\"[runner] worker.16 took 1.0002ms with stages: errcheck: 1.0002ms\"\r\nlevel=info msg=\"[runner] worker.6 took 1.0002ms with stages: deadcode: 1.0002ms\"\r\nlevel=info msg=\"[runner] worker.10 took 1.0002ms with stages: ineffassign: 1.0002ms\"\r\nlevel=info msg=\"[runner] worker.1 took 4.0006ms with stages: govet: 4.0006ms\"\r\nlevel=info msg=\"[runner] worker.3 took 86.011ms with stages: megacheck: 86.011ms\"\r\nlevel=info msg=\"[runner] worker.2 took 95.0121ms with stages: gofmt: 95.0121ms\"\r\nlevel=info msg=\"[runner] Workers idle times: #1: 43.0054ms, #3: 8.5011ms, #4: 84.0106ms, #5: 94.0119ms, #6: 55.007ms, #7: 100.01\r\n27ms, #8: 89.0113ms, #9: 68.0086ms, #10: 48.5061ms, #11: 81.5103ms, #12: 97.0123ms, #13: 91.5116ms, #14: 70.5089ms, #15: 75.5096\r\nms, #16: 61.5078ms\"\r\nlevel=warning msg=\"[runner] Can't run linter gofmt: can't extract issues from gofmt diff output \\\"--- G:/dev/linttest/main.go.or\r\nig\\\\t2018-11-26 18:09:06.346770400 +0000\\\\r\\\\n+++ G:/dev/linttest/main.go\\\\t2018-11-26 18:09:06.347770400 +0000\\\\r\\\\n@@ -2,8 +2,\r\n8 @@\\\\r\\\\n \\\\r\\\\n import (\\\\r\\\\n \\\\t// goimports error - wrong order\\\\r\\\\n-\\\\t\\\\\\\"time\\\\\\\"\\\\r\\\\n \\\\t\\\\\\\"fmt\\\\\\\"\\\\r\\\\n+\\\\t\\\\\\\"tim\r\ne\\\\\\\"\\\\r\\\\n )\\\\r\\\\n \\\\r\\\\n func main() {\\\\r\\\\n\\\": can't parse patch: line 3, char 149: bad hunk header: @@ -2,8 +2,8 @@\\r\"\r\nlevel=info msg=\"[runner] processing took 0s with stages: autogenerated_exclude: 0s, diff: 0s, path_prettifier: 0s, cgo: 0s, noli\r\nnt: 0s, uniq_by_line: 0s, skip_files: 0s, skip_dirs: 0s, max_same_issues: 0s, exclude: 0s, max_per_file_from_linter: 0s, max_fro\r\nm_linter: 0s, source_code: 0s, path_shortener: 0s\"\r\nlevel=info msg=\"Memory: 34 samples, avg is 61.7MB, max is 236.2MB\"\r\nlevel=info msg=\"Execution took 3.4024321s\"\r\n```\r\nVersion\r\n```\r\ngolangci-lint has version 1.12.3 built from 014a924 on 2018-11-24T08:54:08Z\r\n```\r\n\r\nOutput from `go version && go env`:\r\n```\r\ngo version go1.11.1 windows/amd64\r\nset GOARCH=amd64\r\nset GOBIN=\r\nset GOCACHE=C:\\Users\\CDrew\\AppData\\Local\\go-build\r\nset GOEXE=.exe\r\nset GOFLAGS=\r\nset GOHOSTARCH=amd64\r\nset GOHOSTOS=windows\r\nset GOOS=windows\r\nset GOPATH=G:\\dev\\GoWork\r\nset GOPROXY=\r\nset GORACE=\r\nset GOROOT=D:\\Go\r\nset GOTMPDIR=\r\nset GOTOOLDIR=D:\\Go\\pkg\\tool\\windows_amd64\r\nset GCCGO=gccgo\r\nset CC=gcc\r\nset CXX=g++\r\nset CGO_ENABLED=1\r\nset GOMOD=G:\\dev\\linttest\\go.mod\r\nset CGO_CFLAGS=-g -O2\r\nset CGO_CPPFLAGS=\r\nset CGO_CXXFLAGS=-g -O2\r\nset CGO_FFLAGS=-g -O2\r\nset CGO_LDFLAGS=-g -O2\r\nset PKG_CONFIG=pkg-config\r\nset GOGCCFLAGS=-m64 -mthreads -fmessage-length=0 -fdebug-prefix-map=D:\\NOTBAC~1\\Temp\\go-build767837518=/tmp/go-build -gno-record\r\n-gcc-switches\r\n```\r\nThe file I'm linting has a simple linting error:\r\n```\r\npackage main\r\n\r\nimport (\r\n\t// goimports error - wrong order\r\n\t\"time\"\r\n\t\"fmt\"\r\n)\r\n\r\nfunc main() {\r\n\tfmt.Println(\"The time is\", time.Now())\r\n}\r\n\r\n```"},"comment":{"url":"https://api.github.com/repos/golangci/golangci-lint/issues/comments/442202867","html_url":"https://github.com/golangci/golangci-lint/issues/307#issuecomment-442202867","issue_url":"https://api.github.com/repos/golangci/golangci-lint/issues/307","id":442202867,"node_id":"MDEyOklzc3VlQ29tbWVudDQ0MjIwMjg2Nw==","user":{"login":"jirfag","id":4648736,"node_id":"MDQ6VXNlcjQ2NDg3MzY=","avatar_url":"https://avatars3.githubusercontent.com/u/4648736?v=4","gravatar_id":"","url":"https://api.github.com/users/jirfag","html_url":"https://github.com/jirfag","followers_url":"https://api.github.com/users/jirfag/followers","following_url":"https://api.github.com/users/jirfag/following{/other_user}","gists_url":"https://api.github.com/users/jirfag/gists{/gist_id}","starred_url":"https://api.github.com/users/jirfag/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jirfag/subscriptions","organizations_url":"https://api.github.com/users/jirfag/orgs","repos_url":"https://api.github.com/users/jirfag/repos","events_url":"https://api.github.com/users/jirfag/events{/privacy}","received_events_url":"https://api.github.com/users/jirfag/received_events","type":"User","site_admin":false},"created_at":"2018-11-27T20:20:01Z","updated_at":"2018-11-27T20:20:01Z","author_association":"COLLABORATOR","body":"ok, got it. I've looked into the error text, looks like diff-parsing library doesn't support `\\r`, I will fix it."}}
{"actor":{"display_login":"jirfag"}}