Skip to content

Commit

Permalink
chore: use slices.Sort instead of sort.Strings
Browse files Browse the repository at this point in the history
  • Loading branch information
luantranminh committed Apr 22, 2024
1 parent 498be9c commit 225269e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions gormschema/gorm.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"database/sql/driver"
"errors"
"fmt"
"sort"
"slices"

"ariga.io/atlas-go-sdk/recordriver"
"gorm.io/driver/mysql"
Expand Down Expand Up @@ -155,7 +155,7 @@ func (m *migrator) CreateConstraints(models []any) error {
}
// since Relations is a map, the order of the keys is not guaranteed
// so we sort the keys to make the sql output deterministic
sort.Strings(relationNames)
slices.Sort(relationNames)

for _, name := range relationNames {
rel := stmt.Schema.Relationships.Relations[name]
Expand Down

0 comments on commit 225269e

Please sign in to comment.