go format + make testapp take input

This commit is contained in:
Martin Holst Swende 2018-09-12 15:04:35 +02:00
parent be3c235ccd
commit fbd806564e
No known key found for this signature in database
GPG Key ID: 683B438C05A5DDF0
6 changed files with 23 additions and 15 deletions

View File

@ -6,11 +6,13 @@ import (
"github.com/nbutton23/zxcvbn-go/data"
)
// List holds a frequency list
type List struct {
Name string
List []string
}
// Lists holds all the frequency list in a map
var Lists = make(map[string]List)

View File

@ -1,9 +1,9 @@
package matching
import (
"regexp"
"strconv"
"strings"
"regexp"
"github.com/nbutton23/zxcvbn-go/entropy"
"github.com/nbutton23/zxcvbn-go/match"

View File

@ -1,12 +1,19 @@
package main
import (
"bufio"
"fmt"
"os"
"github.com/nbutton23/zxcvbn-go"
)
func main() {
password := "Testaaatyhg890l33t"
fmt.Println("Enter password:")
reader := bufio.NewReader(os.Stdin)
password, _ := reader.ReadString('\n')
//password := "Testaaatyhg890l33t"
passwordStenght := zxcvbn.PasswordStrength(password, nil)

View File

@ -1,8 +1,8 @@
package zxcvbn
import (
"testing"
"math"
"testing"
)
/**
@ -56,7 +56,6 @@ func TestPasswordStrength(t *testing.T) {
var formatString = "%s : error should be less than %.2f Acctual error: %.4f Expected entropy %.4f Actual entropy %.4f \n"
func runTest(t *testing.T, password string, pythonEntropy float64) {
goEntropy := GoPasswordStrength(password, nil)