Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NOISSUE - Pin the version of golangci-lint #2077

Merged
merged 1 commit into from
Feb 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ jobs:
cache-dependency-path: "go.sum"

- name: golangci-lint
uses: golangci/golangci-lint-action@v3
uses: golangci/golangci-lint-action@v4
with:
version: latest
version: v1.56.1

- name: Build all Binaries
run: |
Expand Down
2 changes: 1 addition & 1 deletion auth/postgres/domains.go
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ func (repo domainRepo) RetrievePermissions(ctx context.Context, subject, id stri
// RetrieveAllByIDs retrieves for given Domain IDs .
func (repo domainRepo) RetrieveAllByIDs(ctx context.Context, pm auth.Page) (auth.DomainsPage, error) {
var q string
if len(pm.IDs) <= 0 {
if len(pm.IDs) == 0 {
return auth.DomainsPage{}, nil
}
query, err := buildPageQuery(pm)
Expand Down
2 changes: 1 addition & 1 deletion auth/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -948,7 +948,7 @@ func DecodeDomainUserID(domainUserID string) (string, string) {
return duid[0], duid[1]
case len(duid) == 1:
return duid[0], ""
case len(duid) <= 0 || len(duid) > 2:
case len(duid) == 0 || len(duid) > 2:
fallthrough
default:
return "", ""
Expand Down
1 change: 0 additions & 1 deletion bootstrap/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,6 @@ func (bs bootstrapService) Add(ctx context.Context, token string, cfg Config) (C
}

cfg.Channels, err = bs.connectionChannels(toConnect, bs.toIDList(existing), token)

if err != nil {
return Config{}, errors.Wrap(errConnectionChannels, err)
}
Expand Down
2 changes: 1 addition & 1 deletion internal/groups/postgres/groups.go
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ func (repo groupRepository) RetrieveAll(ctx context.Context, gm mggroups.Page) (

func (repo groupRepository) RetrieveByIDs(ctx context.Context, gm mggroups.Page, ids ...string) (mggroups.Page, error) {
var q string
if (len(ids) <= 0) && (gm.PageMeta.DomainID == "") {
if (len(ids) == 0) && (gm.PageMeta.DomainID == "") {
return mggroups.Page{PageMeta: mggroups.PageMeta{Offset: gm.Offset, Limit: gm.Limit}}, nil
}
query := buildQuery(gm, ids...)
Expand Down
2 changes: 1 addition & 1 deletion internal/server/grpc/grpc.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ func (s *Server) Start() error {
}
creds = grpc.Creds(credentials.NewTLS(tlsConfig))
switch {
case len(mtlsCA) > 0:
case mtlsCA != "":
s.Logger.Info(fmt.Sprintf("%s service gRPC server listening at %s with TLS/mTLS cert %s , key %s and %s", s.Name, s.Address, s.Config.CertFile, s.Config.KeyFile, mtlsCA))
default:
s.Logger.Info(fmt.Sprintf("%s service gRPC server listening at %s with TLS cert %s and key %s", s.Name, s.Address, s.Config.CertFile, s.Config.KeyFile))
Expand Down
1 change: 0 additions & 1 deletion pkg/messaging/rabbitmq/publisher.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,6 @@ func (pub *publisher) Publish(ctx context.Context, topic string, msg *messaging.
AppId: "magistrala-publisher",
Body: data,
})

if err != nil {
return err
}
Expand Down
4 changes: 2 additions & 2 deletions things/api/http/requests.go
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,7 @@ func (req *thingShareRequest) validate() error {
if req.thingID == "" {
return errors.ErrMalformedEntity
}
if req.Relation == "" || len(req.UserIDs) <= 0 {
if req.Relation == "" || len(req.UserIDs) == 0 {
return errors.ErrCreateEntity
}
return nil
Expand All @@ -356,7 +356,7 @@ func (req *thingUnshareRequest) validate() error {
if req.thingID == "" {
return errors.ErrMalformedEntity
}
if req.Relation == "" || len(req.UserIDs) <= 0 {
if req.Relation == "" || len(req.UserIDs) == 0 {
return errors.ErrCreateEntity
}
return nil
Expand Down
2 changes: 1 addition & 1 deletion twins/mocks/twins.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ func (trm *twinRepositoryMock) RetrieveAll(_ context.Context, owner string, offs
if (uint64)(len(items)) >= limit {
break
}
if len(name) > 0 && v.Name != name {
if name != "" && v.Name != name {
continue
}
if !strings.HasPrefix(k, owner) {
Expand Down
Loading