Thanks to visit codestin.com
Credit goes to github.com

Skip to content

carsonfeng/garra

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

35 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Garra

Garra is a Go best practices checker based on go vet.

Requirements

-Go 1.10 and above.

Features

  • nilcheck not nil err but object used checker

    • Example:
        user, err := svc.User().GetUserCache(uid)
        if nil != err{
          printf("err occurs)
        }
        user.GetUid() // <-- fail! haven't check user
  • sawago go routine specification in Ziipin Sawa.

    • Example:

      • SUGGEST:
        func (dao *UserService)testFunc(){
          asynHandle(func(svc *Svc) {
            //XXXX
          })
        }
      • NOT SUGGEST:
        func (dao *UserService)testFunc(){
          go func() {
            //XXX
          }
        }

Installation

  • go install -a github.com/carsonfeng/garra@latest

Usage

  • go vet -vettool=$(which garra) ./...

Contributing

The project welcomes all contributors. We appreciate your help!

Communication:

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published