16 lines
268 B
Go
16 lines
268 B
Go
package cart
|
|
|
|
import (
|
|
"errors"
|
|
|
|
messages "git.k6n.net/go-cart-actor/pkg/messages"
|
|
)
|
|
|
|
func SetUserId(grain *CartGrain, req *messages.SetUserId) error {
|
|
if req.UserId == "" {
|
|
return errors.New("user ID cannot be empty")
|
|
}
|
|
grain.userId = req.UserId
|
|
return nil
|
|
}
|