mirror of
https://github.com/harness/drone.git
synced 2025-05-02 13:40:22 +00:00
26 lines
611 B
Go
26 lines
611 B
Go
// Copyright 2021 Harness Inc. All rights reserved.
|
|
// Use of this source code is governed by the Polyform Free Trial License
|
|
// that can be found in the LICENSE.md file for this repository.
|
|
|
|
package check
|
|
|
|
import (
|
|
"errors"
|
|
|
|
"github.com/harness/gitness/types"
|
|
)
|
|
|
|
var (
|
|
// ErrEmailLen is returned when the email address
|
|
// exceeds the maximum number of characters.
|
|
ErrEmailLen = errors.New("Email address cannot exceed 250 characters")
|
|
)
|
|
|
|
// User returns true if the User if valid.
|
|
func User(user *types.User) (bool, error) {
|
|
if len(user.Email) > 250 {
|
|
return false, ErrEmailLen
|
|
}
|
|
return true, nil
|
|
}
|