MCPcopy Index your code
hub / github.com/kopia/kopia / askForChangedRepositoryPassword

Function askForChangedRepositoryPassword

cli/password.go:37–55  ·  view source on GitHub ↗
(out io.Writer)

Source from the content-addressed store, hash-verified

35}
36
37func askForChangedRepositoryPassword(out io.Writer) (string, error) {
38 for {
39 p1, err := askPass(out, "Enter new password: ")
40 if err != nil {
41 return "", errors.Wrap(err, "password entry")
42 }
43
44 p2, err := askPass(out, "Re-enter password for verification: ")
45 if err != nil {
46 return "", errors.Wrap(err, "password verification")
47 }
48
49 if p1 != p2 {
50 fmt.Println("Passwords don't match!")
51 } else {
52 return p1, nil
53 }
54 }
55}
56
57func askForExistingRepositoryPassword(out io.Writer) (string, error) {
58 p1, err := askPass(out, "Enter password to open repository: ")

Callers 1

runMethod · 0.85

Calls 1

askPassFunction · 0.85

Tested by

no test coverage detected