This commit is contained in:
Greg 2019-09-10 11:36:03 -04:00
parent 2c4c708b3a
commit 12b57d263f
5 changed files with 51 additions and 53 deletions

View File

@ -223,7 +223,7 @@ func eventLoop() {
log(Info, err)
return
}
for i,n := range ids {
for i, n := range ids {
if i >= len(idBtns) {
idBtns = append(idBtns, &Button{
Face: face,
@ -496,7 +496,7 @@ func eventLoop() {
insValue = passvalEd.Text()
for _, n := range pathnames {
if insName == n {
log(Info,"Password exists")
log(Info, "Password exists")
page = confirmPage
w.Invalidate()
return

View File

@ -69,7 +69,7 @@ func main() {
if opts.clip {
passgo.Clip(p)
} else {
fmt.Print(p)
fmt.Println(p)
}
default:
usage()

View File

@ -22,4 +22,3 @@ func (s *Store) nativeEncrypt(pw string) ([]byte, error) {
func nativeIdentities() ([]string, error) {
return nil, fmt.Errorf("NOT IMPLEMENTED")
}

View File

@ -11,14 +11,14 @@ import (
"os/exec"
"os/user"
"path"
"strings"
"strconv"
"strings"
"sync"
"golang.org/x/crypto/openpgp"
"github.com/jcmdev0/gpgagent"
"github.com/fsnotify/fsnotify"
"github.com/jcmdev0/gpgagent"
)
func (s *Store) nativeDecrypt(name string) (string, error) {
@ -59,11 +59,11 @@ func nativeIdentities() ([]string, error) {
idMux.Lock()
defer idMux.Unlock()
if cachedIdentities != nil {
ret := make([]string,len(cachedIdentities))
ret := make([]string, len(cachedIdentities))
copy(ret, cachedIdentities)
return ret, nil
}
ret := make([]string,0)
ret := make([]string, 0)
fmt.Println("calling gpg")
output, err := exec.Command("gpg", "--list-secret-keys", "--with-colons").Output()
if err != nil {
@ -71,9 +71,9 @@ func nativeIdentities() ([]string, error) {
}
scanner := bufio.NewScanner(bytes.NewBuffer(output))
for scanner.Scan() {
fs := strings.Split(scanner.Text(),":")
fs := strings.Split(scanner.Text(), ":")
if fs[0] == "uid" {
fmt.Printf("%s: %s\n",fs[0], fs[9])
fmt.Printf("%s: %s\n", fs[0], fs[9])
ret = append(ret, fs[9])
}
}
@ -211,4 +211,3 @@ func Clip(x string) {
cmd.Stdin = b
cmd.Run()
}

View File

@ -107,7 +107,7 @@ func (s *Store) SetID(id string) error {
return err
}
}
return ioutil.WriteFile(path.Join(s.Dir, ".gpg-id"), []byte(id + "\n"), 0644)
return ioutil.WriteFile(path.Join(s.Dir, ".gpg-id"), []byte(id+"\n"), 0644)
}
type caseInsensitive []os.FileInfo
@ -285,5 +285,5 @@ func (s *Store) Insert(name, value string) error {
return err
}
//}
return ioutil.WriteFile(path.Join(s.Dir, name + ".gpg"), enc, 0644)
return ioutil.WriteFile(path.Join(s.Dir, name+".gpg"), enc, 0644)
}