Files
create-task-apcomp/main.go
darwincereska 757758293f fix
2026-04-01 21:42:00 -04:00

44 lines
752 B
Go

package main
import (
"create/password"
"create/web"
"fmt"
"os"
)
func main() {
var input string // Users inputted password
fmt.Println("Welcome to Password Checker")
// Fetch common words
commonWords, err := web.FetchCommonWords()
if err != nil {
fmt.Printf("ERROR: %v\n", err)
os.Exit(1)
}
// Fetch common passwords
commonPasswords, err := web.FetchCommonPasswords()
if err != nil {
fmt.Printf("ERROR: %v\n", err)
os.Exit(1)
}
for {
// Fetch user input
fmt.Print("Enter your password: ")
fmt.Scanf("%s", &input)
fmt.Println(input)
// Check users password
message, err := password.Check(input, commonWords, commonPasswords)
if err != nil {
fmt.Printf("ERROR: %v\n", err)
}
fmt.Println(message)
}
}