Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[#47] [Pipeline] Fix YDBGo pipeline failure in lint_code job due to G…
…O111MODULE=off **Problem** After bump YDBGo wrapper version to odd development version v1.2.5 in YDBGo!185, Daily pipeline failed with this error. ```shell $ go get -u golang.org/x/lint/golint 345# golang.org/x/tools/go/types/objectpath 346/go/src/golang.org/x/tools/go/types/objectpath/objectpath.go:397:10: meth.Origin undefined (type *types.Func has no field or method Origin) ``` **Cause** The cause of this problem likely to be `GO111MODULE=off` (Reference : dominikh/go-tools#653, #47). From the reference GO111MODULE=off might have some problem with linter. **Solution** Change `GO111MODULE=off` to `GO111MODULE=on` but in only lint_code section to reduce impact to the whole pipeline. But after `GO111MODULE=on` some change need to be apply here because we're using Go module. After some research, `go get -u golang.org/x/lint/golint` need to change to `go install golang.org/x/lint/golint@latest`. `go get` when `GO111MODULE=off` will download source package and compiled it to a binary but `GO111MODULE=on`, it won't. So, `go install` would be a solution because it will download source code and compile it to binary as we want. (Reference : https://medium.com/@chaewonkong/difference-between-go-get-and-go-install-in-go-a076d7352186)
- Loading branch information