fix: G601: Implicit memory aliasing in for loop
Signed-off-by: Mario Constanti <mario.constanti@mercedes-benz.com>
This commit is contained in:
parent
60dbf97ba4
commit
4409beb18a
3 changed files with 6 additions and 6 deletions
|
|
@ -181,8 +181,8 @@ func (s *sqlDatabase) CreateEnterprisePool(ctx context.Context, enterpriseID str
|
|||
return params.Pool{}, errors.Wrap(q.Error, "adding pool")
|
||||
}
|
||||
|
||||
for _, tt := range tags {
|
||||
if err := s.conn.Model(&newPool).Association("Tags").Append(&tt); err != nil {
|
||||
for i := range tags {
|
||||
if err := s.conn.Model(&newPool).Association("Tags").Append(&tags[i]); err != nil {
|
||||
return params.Pool{}, errors.Wrap(err, "saving tag")
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -198,8 +198,8 @@ func (s *sqlDatabase) CreateOrganizationPool(ctx context.Context, orgID string,
|
|||
return params.Pool{}, errors.Wrap(q.Error, "adding pool")
|
||||
}
|
||||
|
||||
for _, tt := range tags {
|
||||
if err := s.conn.Model(&newPool).Association("Tags").Append(&tt); err != nil {
|
||||
for i := range tags {
|
||||
if err := s.conn.Model(&newPool).Association("Tags").Append(&tags[i]); err != nil {
|
||||
return params.Pool{}, errors.Wrap(err, "saving tag")
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -198,8 +198,8 @@ func (s *sqlDatabase) CreateRepositoryPool(ctx context.Context, repoID string, p
|
|||
return params.Pool{}, errors.Wrap(q.Error, "adding pool")
|
||||
}
|
||||
|
||||
for _, tt := range tags {
|
||||
if err := s.conn.Model(&newPool).Association("Tags").Append(&tt); err != nil {
|
||||
for i := range tags {
|
||||
if err := s.conn.Model(&newPool).Association("Tags").Append(&tags[i]); err != nil {
|
||||
return params.Pool{}, errors.Wrap(err, "saving tag")
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue