Skip to content

Commit 9bb7bc0

Browse files
committed
refactor(randomstring.go): remove unused generateStringFromCharset function
refactor(randomstring.go): remove unused modifyCharset function The generateStringFromCharset and modifyCharset functions are no longer used in the codebase and can be safely removed to improve code readability and maintainability.
1 parent 1f77e70 commit 9bb7bc0

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

randomstring.go

+4
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ type GenerationOptions struct {
3030
CustomCharset Charset
3131
}
3232

33+
// generateStringFromCharset generates a random string from a given charset
3334
func generateStringFromCharset(charset Charset, length int) (string, error) {
3435
if len(charset) == 0 || length <= 0 {
3536
return "", errors.New("invalid charset or length")
@@ -47,6 +48,8 @@ func generateStringFromCharset(charset Charset, length int) (string, error) {
4748

4849
return string(result), nil
4950
}
51+
52+
// modifyCharset modifies the charset based on the options
5053
func modifyCharset(opts GenerationOptions, charsetMappings map[string]Charset, charset Charset) Charset {
5154
if opts.DisableNumeric {
5255
charset = Charset(strings.ReplaceAll(string(charset), string(charsetMappings["numeric"]), ""))
@@ -63,6 +66,7 @@ func modifyCharset(opts GenerationOptions, charsetMappings map[string]Charset, c
6366
return charset
6467
}
6568

69+
// generateString generates a random string based on the options
6670
func generateString(opts GenerationOptions) (string, error) {
6771
charsetMappings := map[string]Charset{
6872
"numeric": Numeric,

0 commit comments

Comments
 (0)