Go: sort: function names should be mixed caps

Created on 30 Jul 2018  路  2Comments  路  Source: golang/go

According to Effective Go, function names should be mixed caps, but *_func including the underscore is used for the ones in sort/zfuncversion.go generated by sort/genzfunc.go. Thus when generating these functions, we should use Func instead of _func.

FrozenDueToAge NeedsDecision

Most helpful comment

Thanks for the report.

The suggestions in the Effective Go document do not really apply to auto-generated code. In fact, I suspect the _func prefix was chosen exactly to make the functions look like they are auto-generated (as they are).

All 2 comments

Thanks for the report.

The suggestions in the Effective Go document do not really apply to auto-generated code. In fact, I suspect the _func prefix was chosen exactly to make the functions look like they are auto-generated (as they are).

This is generated code. Such code is often non-conformant stylewise.

Was this page helpful?
0 / 5 - 0 ratings