micro icon indicating copy to clipboard operation
micro copied to clipboard

go linter only partial work on Windows

Open tadvi opened this issue 8 years ago • 3 comments

Description of the problem or steps to reproduce

micro/linter.lua line: lint("gobuild", "go", {"build", "-o", devnull}, "%f:%l: %m")

Does not seem to parse output from "go build -o NUL" on Windows correctly.

Specifications

On Windows go build reports errors like:

.\puzzle.go:21: undefined: max .\puzzle.go:29: undefined: max

You can use micro -version to get the commit hash.

Version: 1.1.5-181 Commit hash: 5514e53 Compiled on May 17, 2017

tadvi avatar May 17 '17 18:05 tadvi

On Windows path separator is \ not / so fix on Windows would be in linter.lua file basename(file) function . Please make a change to use specific path separator for Windows.

function basename(file) local name = string.gsub(file, "(.\)(.)", "%2") -- it used to fail here return name end

tadvi avatar May 17 '17 19:05 tadvi

Somehow Github eat double \ required in expression.

tadvi avatar May 17 '17 19:05 tadvi

Is this issue still observed with a recent version of micro?

Looks like it was fixed long ago by https://github.com/zyedidia/micro/commit/5ec08d0a295112c341ab99fe7648fa8d7dbba512

dmaluka avatar Apr 14 '24 23:04 dmaluka