go-gorm / sqlserver

GORM sqlserver driver
MIT License
56 stars 39 forks source link

1.4.0 compilation issue #72

Closed CristianHenzel closed 2 years ago

CristianHenzel commented 2 years ago

Version 1.4.0 fails compilation with errors: /go/pkg/mod/gorm.io/driver/sqlserver@1.4.0/sqlserver.go:90:23: invalid operation: limit.Limit != nil (mismatched types int and untyped nil) /go/pkg/mod/gorm.io/driver/sqlserver@1.4.0/sqlserver.go:90:31: invalid operation: cannot indirect limit.Limit (variable of type int) /go/pkg/mod/gorm.io/driver/sqlserver@1.4.0/sqlserver.go:95:40: invalid operation: cannot indirect limit.Limit (variable of type int)

The issue is caused by this PR: #70 , which:

  1. Compares the int limit.Limit to nil
  2. Indirects limit.Limit, which is not a pointer
jinzhu commented 2 years ago

Upgrade gorm.io/gorm and the sqlserver driver both to the latest version should fix the issue.