mirror of
https://github.com/rjNemo/go-pass-gen
synced 2026-06-06 02:46:40 +00:00
16 lines
329 B
Go
16 lines
329 B
Go
package passgen
|
|
|
|
type Options struct {
|
|
// Length of the new password
|
|
Length int
|
|
// WithNumbers is set to true if the password must contain numbers.
|
|
WithNumbers bool
|
|
}
|
|
|
|
// SetDefaults ensure options are usable to avoid certain bugs.
|
|
func (o *Options) SetDefaults() *Options {
|
|
if o.Length == 0 {
|
|
o.Length = 6
|
|
}
|
|
return o
|
|
}
|