globe-and-citizen / layer8

This repo contains the Layer8 Resource/Authentication Server, Proxy, and Service Provider Mocks
GNU General Public License v2.0
1 stars 2 forks source link

Integration of a Linter #125

Open stravid87 opened 2 months ago

stravid87 commented 2 months ago

I have noticed such changes being committed:

func (r *Repository) IsBackendURIExists(backendURL string) (bool, error) {
    var count int64
    if err := r.connection.Model(&models.Client{}).Where("backend_uri = ?", backendURL).Count(&count).Error; err != nil {
        return false, err
    }
    return count > 0, nil
}

vs

func (r *Repository) IsBackendURIExists(backendURL string) (bool, error) {
    var count int64
    if err := r.connection.Model(&models.Client{}).Where("backend_uri = ?", backendURL).Count(&count).Error; err != nil {
        return false, err
    }
    return count > 0, nil
}

Golangci-lint would be my suggestion.

How to Install

How to install using a chain of trust: NPM => chocolatey => golangci-lint

Short List of Suggested Linters