Migrat pkg/password to using pkglib package
This commit is contained in:
parent
010fd536ea
commit
aa3580c248
11 changed files with 56 additions and 158 deletions
23
internal/passwordx/common.go
Normal file
23
internal/passwordx/common.go
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
package passwordx
|
||||
|
||||
import (
|
||||
"embed"
|
||||
|
||||
"github.com/tkw1536/pkglib/password"
|
||||
)
|
||||
|
||||
//go:embed common
|
||||
var commonEmbed embed.FS
|
||||
|
||||
var Sources []password.PasswordSource
|
||||
|
||||
func init() {
|
||||
var err error
|
||||
Sources, err = password.NewSources(commonEmbed, "**/*.txt")
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
if len(Sources) == 0 {
|
||||
panic("no sources")
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue