Mercurial > go > multipass
comparison cmds/multipass-add/add.go @ 18:00d30c67b56d
Put all the library stuff into multipass/file.
| author | Paul Fisher <paul@pfish.zone> |
|---|---|
| date | Sun, 01 Nov 2015 12:16:51 -0500 |
| parents | 342f63116bfd |
| children |
comparison
equal
deleted
inserted
replaced
| 17:342f63116bfd | 18:00d30c67b56d |
|---|---|
| 5 import ( | 5 import ( |
| 6 "bufio" | 6 "bufio" |
| 7 "fmt" | 7 "fmt" |
| 8 "os" | 8 "os" |
| 9 | 9 |
| 10 "pfish.zone/go/multipass/auth" | |
| 11 "pfish.zone/go/multipass/file" | 10 "pfish.zone/go/multipass/file" |
| 12 ) | 11 ) |
| 13 | 12 |
| 14 func main() { | 13 func main() { |
| 15 passfile, err := file.ForMe() | 14 passfile, err := file.ForMe() |
| 23 if err != nil { | 22 if err != nil { |
| 24 fmt.Println(err.Error()) | 23 fmt.Println(err.Error()) |
| 25 os.Exit(1) | 24 os.Exit(1) |
| 26 } | 25 } |
| 27 text = text[:len(text)-1] | 26 text = text[:len(text)-1] |
| 28 entry, password, err := auth.NewEntry(text) | 27 entry, password, err := file.NewEntry(text) |
| 29 if err != nil { | 28 if err != nil { |
| 30 fmt.Println(err.Error()) | 29 fmt.Println(err.Error()) |
| 31 os.Exit(1) | 30 os.Exit(1) |
| 32 } | 31 } |
| 33 err = passfile.Add(entry) | 32 err = passfile.Add(entry) |
