Skip to content
This repository was archived by the owner on Mar 4, 2025. It is now read-only.
This repository was archived by the owner on Mar 4, 2025. It is now read-only.

common/validate.go: redundant check for invalidChar #225

@3052

Description

@3052

if unicode.IsControl(j) || unicode.Is(unicode.C, j) {
invalidChar = true
}

dbhub.io/common/validate.go

Lines 181 to 183 in f467849

if unicode.IsControl(j) || unicode.Is(unicode.C, j) {
invalidChar = true
}

the IsControl checks are redundant, because unicode.C includes all control characters.

package main

import (
   "fmt"
   "unicode"
)

func main() {
   fmt.Println(unicode.IsControl(0)) // true
   fmt.Println(unicode.Is(unicode.C, 0)) // true
}

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions