mirror of
https://github.com/juanfont/headscale.git
synced 2025-11-02 05:57:46 +09:00
fix: add valid test identified by linter
This commit is contained in:
@@ -271,9 +271,9 @@ func (n *Namespace) toProto() *v1.Namespace {
|
||||
func NormalizeNamespaceName(name string, stripEmailDomain bool) (string, error) {
|
||||
name = strings.ToLower(name)
|
||||
name = strings.ReplaceAll(name, "'", "")
|
||||
if stripEmailDomain {
|
||||
idx := strings.Index(name, "@")
|
||||
name = name[:idx]
|
||||
atIdx := strings.Index(name, "@")
|
||||
if stripEmailDomain && atIdx > 0 {
|
||||
name = name[:atIdx]
|
||||
} else {
|
||||
name = strings.ReplaceAll(name, "@", ".")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user