In Go, it is common to have variables named inputURL or userID. This is what the "github.com/ettle/strcase" package calls a "Go initialism".
Let's assume that we have key-naming-case set to camel and we want to log the inputURL value.
We might try something like: slog.Info("Getting data from website", slog.String("inputURL", inputURL))
This will be caught by the linter, because it would want the key as inputUrl. However, I want to allow "Go initialisms". Luckily, "github.com/ettle/strcase" does allow this with their strcase.ToGo* functions.
So my request is to add a separate value for key-naming-case corresponding to the current values of camel, pascal, kebab, and snake. These values would call the strcase.ToGo* version of the function instead of strcase.To*. For example go-camel would call strcase.ToGoCamel while camel would continue to call strcase.ToCamel.
In Go, it is common to have variables named
inputURL
oruserID
. This is what the"github.com/ettle/strcase"
package calls a "Go initialism".Let's assume that we have
key-naming-case
set tocamel
and we want to log theinputURL
value. We might try something like:slog.Info("Getting data from website", slog.String("inputURL", inputURL))
This will be caught by the linter, because it would want the key as
inputUrl
. However, I want to allow "Go initialisms". Luckily,"github.com/ettle/strcase"
does allow this with theirstrcase.ToGo*
functions.So my request is to add a separate value for
key-naming-case
corresponding to the current values ofcamel
,pascal
,kebab
, andsnake
. These values would call thestrcase.ToGo*
version of the function instead ofstrcase.To*
. For examplego-camel
would callstrcase.ToGoCamel
whilecamel
would continue to callstrcase.ToCamel
.