You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@apisix.apache.org by Zexuan Luo <sp...@apache.org> on 2020/08/30 02:53:55 UTC

[DISCUSS] add golangci-linter to Go projects

Currently we have two projects written in Go:
https://github.com/apache/apisix-control-plane
https://github.com/apache/apisix-dashboard

These two projects don't have linter to check the code quality.

It is common practice to use golangci-linter to lint the Go code. I have
run it under these projects, and:
* found a typo bug which causes the omitempty doesn't work as expected:
https://github.com/apache/apisix-control-plane/commit/b182a6512bb0e52847ffcea56016049832c4a193
* found several warnings in apisix-dashboard

I have submitted a PR to apisix-control-plane to set up the golangci-linter
in CI: https://github.com/apache/apisix-control-plane/pull/17/files
I am glad to do the same with apisix-dashboard, after solving all the
warnings in a separate PR, if the linter is acceptable.

Re: [DISCUSS] add golangci-linter to Go projects

Posted by junxu chen <ch...@apache.org>.
+1

On Sun, Aug 30, 2020 at 1:45 PM Ming Wen <we...@apache.org> wrote:

> great job!
>
> Zhiyuan Ju <ju...@apache.org> 于 2020年8月30日周日 下午1:39写道:
>
> > Looks good to me
> >
> > Best Regards!
> > @ Zhiyuan Ju <https://www.shaoyaoju.org/>
> >
> >
> > bzp2010 <bz...@apache.org> 于2020年8月30日周日 下午12:27写道:
> >
> > > I think it will help improve code quality.
> > >
> > > jinwei <gx...@163.com> 于2020年8月30日周日 上午11:10写道:
> > >
> > > > Great,I think itis useful
> > > >
> > > >
> > > >
> > > >
> > > > On 08/30/2020 10:53, Zexuan Luo wrote:
> > > > Currently we have two projects written in Go:
> > > > https://github.com/apache/apisix-control-plane
> > > > https://github.com/apache/apisix-dashboard
> > > >
> > > > These two projects don't have linter to check the code quality.
> > > >
> > > > It is common practice to use golangci-linter to lint the Go code. I
> > have
> > > > run it under these projects, and:
> > > > * found a typo bug which causes the omitempty doesn't work as
> expected:
> > > >
> > > >
> > >
> >
> https://github.com/apache/apisix-control-plane/commit/b182a6512bb0e52847ffcea56016049832c4a193
> > > > * found several warnings in apisix-dashboard
> > > >
> > > > I have submitted a PR to apisix-control-plane to set up the
> > > golangci-linter
> > > > in CI: https://github.com/apache/apisix-control-plane/pull/17/files
> > > > I am glad to do the same with apisix-dashboard, after solving all the
> > > > warnings in a separate PR, if the linter is acceptable.
> > > >
> > >
> >
>

Re: [DISCUSS] add golangci-linter to Go projects

Posted by Ming Wen <we...@apache.org>.
great job!

Zhiyuan Ju <ju...@apache.org> 于 2020年8月30日周日 下午1:39写道:

> Looks good to me
>
> Best Regards!
> @ Zhiyuan Ju <https://www.shaoyaoju.org/>
>
>
> bzp2010 <bz...@apache.org> 于2020年8月30日周日 下午12:27写道:
>
> > I think it will help improve code quality.
> >
> > jinwei <gx...@163.com> 于2020年8月30日周日 上午11:10写道:
> >
> > > Great,I think itis useful
> > >
> > >
> > >
> > >
> > > On 08/30/2020 10:53, Zexuan Luo wrote:
> > > Currently we have two projects written in Go:
> > > https://github.com/apache/apisix-control-plane
> > > https://github.com/apache/apisix-dashboard
> > >
> > > These two projects don't have linter to check the code quality.
> > >
> > > It is common practice to use golangci-linter to lint the Go code. I
> have
> > > run it under these projects, and:
> > > * found a typo bug which causes the omitempty doesn't work as expected:
> > >
> > >
> >
> https://github.com/apache/apisix-control-plane/commit/b182a6512bb0e52847ffcea56016049832c4a193
> > > * found several warnings in apisix-dashboard
> > >
> > > I have submitted a PR to apisix-control-plane to set up the
> > golangci-linter
> > > in CI: https://github.com/apache/apisix-control-plane/pull/17/files
> > > I am glad to do the same with apisix-dashboard, after solving all the
> > > warnings in a separate PR, if the linter is acceptable.
> > >
> >
>

Re: [DISCUSS] add golangci-linter to Go projects

Posted by Zhiyuan Ju <ju...@apache.org>.
Looks good to me

Best Regards!
@ Zhiyuan Ju <https://www.shaoyaoju.org/>


bzp2010 <bz...@apache.org> 于2020年8月30日周日 下午12:27写道:

> I think it will help improve code quality.
>
> jinwei <gx...@163.com> 于2020年8月30日周日 上午11:10写道:
>
> > Great,I think itis useful
> >
> >
> >
> >
> > On 08/30/2020 10:53, Zexuan Luo wrote:
> > Currently we have two projects written in Go:
> > https://github.com/apache/apisix-control-plane
> > https://github.com/apache/apisix-dashboard
> >
> > These two projects don't have linter to check the code quality.
> >
> > It is common practice to use golangci-linter to lint the Go code. I have
> > run it under these projects, and:
> > * found a typo bug which causes the omitempty doesn't work as expected:
> >
> >
> https://github.com/apache/apisix-control-plane/commit/b182a6512bb0e52847ffcea56016049832c4a193
> > * found several warnings in apisix-dashboard
> >
> > I have submitted a PR to apisix-control-plane to set up the
> golangci-linter
> > in CI: https://github.com/apache/apisix-control-plane/pull/17/files
> > I am glad to do the same with apisix-dashboard, after solving all the
> > warnings in a separate PR, if the linter is acceptable.
> >
>

Re: [DISCUSS] add golangci-linter to Go projects

Posted by bzp2010 <bz...@apache.org>.
I think it will help improve code quality.

jinwei <gx...@163.com> 于2020年8月30日周日 上午11:10写道:

> Great,I think itis useful
>
>
>
>
> On 08/30/2020 10:53, Zexuan Luo wrote:
> Currently we have two projects written in Go:
> https://github.com/apache/apisix-control-plane
> https://github.com/apache/apisix-dashboard
>
> These two projects don't have linter to check the code quality.
>
> It is common practice to use golangci-linter to lint the Go code. I have
> run it under these projects, and:
> * found a typo bug which causes the omitempty doesn't work as expected:
>
> https://github.com/apache/apisix-control-plane/commit/b182a6512bb0e52847ffcea56016049832c4a193
> * found several warnings in apisix-dashboard
>
> I have submitted a PR to apisix-control-plane to set up the golangci-linter
> in CI: https://github.com/apache/apisix-control-plane/pull/17/files
> I am glad to do the same with apisix-dashboard, after solving all the
> warnings in a separate PR, if the linter is acceptable.
>

Re: [DISCUSS] add golangci-linter to Go projects

Posted by jinwei <gx...@163.com>.
Great,I think itis useful




On 08/30/2020 10:53, Zexuan Luo wrote:
Currently we have two projects written in Go:
https://github.com/apache/apisix-control-plane
https://github.com/apache/apisix-dashboard

These two projects don't have linter to check the code quality.

It is common practice to use golangci-linter to lint the Go code. I have
run it under these projects, and:
* found a typo bug which causes the omitempty doesn't work as expected:
https://github.com/apache/apisix-control-plane/commit/b182a6512bb0e52847ffcea56016049832c4a193
* found several warnings in apisix-dashboard

I have submitted a PR to apisix-control-plane to set up the golangci-linter
in CI: https://github.com/apache/apisix-control-plane/pull/17/files
I am glad to do the same with apisix-dashboard, after solving all the
warnings in a separate PR, if the linter is acceptable.