Showing 99 of 99 total issues
Function TestUser
has 63 lines of code (exceeds 50 allowed). Consider refactoring. Open
func TestUser(t *testing.T) {
ts := httptest.NewServer(r)
defer ts.Close()
Function Create
has 6 return statements (exceeds 4 allowed). Open
func Create(w http.ResponseWriter, r *http.Request) {
w.Header().Set("Content-Type", "application/json")
parent := opentracing.GlobalTracer().StartSpan("POST /users")
defer parent.Finish()
Function RecoveryByToken
has 6 return statements (exceeds 4 allowed). Open
func RecoveryByToken(w http.ResponseWriter, r *http.Request) {
w.Header().Set("Content-Type", "application/json")
b, err := ioutil.ReadAll(r.Body)
defer r.Body.Close()
Function VerifyCaptcha
has 6 return statements (exceeds 4 allowed). Open
func VerifyCaptcha(captchaResponse []byte) error {
var captcha Captcha
err := json.Unmarshal(captchaResponse, &captcha)
if err != nil {
return err
Function Recovery
has 5 return statements (exceeds 4 allowed). Open
func Recovery(w http.ResponseWriter, r *http.Request) {
w.Header().Set("Content-Type", "application/json")
b, err := ioutil.ReadAll(r.Body)
defer r.Body.Close()
Function Update
has 5 return statements (exceeds 4 allowed). Open
func Update(w http.ResponseWriter, r *http.Request) {
w.Header().Set("Content-Type", "application/json")
parent := opentracing.GlobalTracer().StartSpan("PUT /users")
defer parent.Finish()
Function Login
has 5 return statements (exceeds 4 allowed). Open
func Login(w http.ResponseWriter, r *http.Request) {
w.Header().Set("Content-Type", "application/json")
b, err := ioutil.ReadAll(r.Body)
defer r.Body.Close()
Function googleCallback
has 5 return statements (exceeds 4 allowed). Open
func googleCallback(w http.ResponseWriter, r *http.Request) {
w.Header().Set("Content-Type", "application/json")
b, err := ioutil.ReadAll(r.Body)
defer r.Body.Close()
exported function Create should have comment or be unexported Open
func Create(w http.ResponseWriter, r *http.Request) {
- Exclude checks
var userId should be userID Open
var userId = chi.URLParam(r, "userId")
- Exclude checks
exported function CheckRefreshToken should have comment or be unexported Open
func CheckRefreshToken(token string) (bool, error) {
- Exclude checks
exported function GetValueByKey should have comment or be unexported Open
func GetValueByKey(token string) (string, error) {
- Exclude checks
exported function Add should have comment or be unexported Open
func Add(user User) (error, User) {
- Exclude checks
exported method StructuredLoggerEntry.Panic should have comment or be unexported Open
func (l *StructuredLoggerEntry) Panic(v interface{}, stack []byte) {
- Exclude checks
Line length Open
Every release, along with the migration instructions, is documented on the Github [Releases](https://github.com/micro-company/go-auth/releases) page.
- Read upRead up
- Exclude checks
MD013 - Line length
Tags: line_length
Aliases: line-length Parameters: linelength, codeblocks, tables (number; default 80, boolean; default true)
This rule is triggered when there are lines that are longer than the configured line length (default: 80 characters). To fix this, split the line up into multiple lines.
This rule has an exception where there is no whitespace beyond the configured line length. This allows you to still include items such as long URLs without being forced to break them in the middle.
You also have the option to exclude this rule for code blocks and tables. To
do this, set the code_blocks
and/or tables
parameters to false.
Code blocks are included in this rule by default since it is often a requirement for document readability, and tentatively compatible with code rules. Still, some languages do not lend themselves to short lines.
exported function NotFoundHandler should have comment or be unexported Open
func NotFoundHandler(w http.ResponseWriter, r *http.Request) {
- Exclude checks
exported function Update should have comment or be unexported Open
func Update(user *User) (*User, error) {
- Exclude checks
exported function Registration should have comment or be unexported Open
func Registration(w http.ResponseWriter, r *http.Request) {
- Exclude checks
exported function VerifyToken should have comment or be unexported Open
func VerifyToken(tokenString string) (*jwt.Token, error) {
- Exclude checks
exported function NewStructuredLogger should have comment or be unexported Open
func NewStructuredLogger(logger *logrus.Logger) func(next http.Handler) http.Handler {
- Exclude checks