Closed xorcare closed 8 months ago
Hello! I suggest to make uuid.Nil and other global uuids as constant to avoid modification at runtime.
One example of a problem I look in practice:
err = rows.Scan( &uuid.Nil, // for group by only //... )
Such a seemingly innocuous change modifies the value of the uuid.Nil variable, and breaks the comparison.
var uid uuid.UUID if uid == uuid.Nil { // This condition doesn't work. }
Unfortunately there is no way to make a constant from an array, and my suggestion is meaningless. My mistake, sorry. 🥲
Hello! I suggest to make uuid.Nil and other global uuids as constant to avoid modification at runtime.
One example of a problem I look in practice:
Such a seemingly innocuous change modifies the value of the uuid.Nil variable, and breaks the comparison.