NOISSUE - Pin the version of golangci-lint (#2077)

Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com>
This commit is contained in:
b1ackd0t
2024-02-12 14:21:33 +03:00
committed by GitHub
parent 3564f19158
commit e77d4eafc5
9 changed files with 9 additions and 11 deletions
+2 -2
View File
@@ -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: |
+1 -1
View File
@@ -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)
+1 -1
View File
@@ -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 "", ""
-1
View File
@@ -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)
}
+1 -1
View File
@@ -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...)
+1 -1
View File
@@ -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))
-1
View File
@@ -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
}
+2 -2
View File
@@ -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
@@ -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
+1 -1
View File
@@ -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) {