Skip to content
This repository has been archived by the owner on Jun 6, 2022. It is now read-only.

Commit

Permalink
gometalinter fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
brycekahle committed Aug 30, 2017
1 parent dad4575 commit 064239a
Show file tree
Hide file tree
Showing 6 changed files with 32 additions and 78 deletions.
22 changes: 6 additions & 16 deletions client.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,24 +60,24 @@ func LoadConfiguration() *onepass.Configuration {
func retrievePasswordFromOnepassword(configuration *onepass.Configuration, done chan bool) {
// Load configuration from a file
client, err := onepass.NewClientWithConfig(configuration)

if err != nil {
os.Exit(1)
}

response, err := client.Authenticate(false)

_, err = client.Authenticate(false)
if err != nil {
os.Exit(1)
}

response, err = client.SendShowPopupCommand()

response, err := client.SendShowPopupCommand()
if err != nil {
os.Exit(1)
}

password, err := response.GetPassword()
if err != nil {
os.Exit(1)
}
fmt.Println(password)

done <- true
Expand All @@ -86,13 +86,11 @@ func retrievePasswordFromOnepassword(configuration *onepass.Configuration, done
func registerWithOnepassword(configuration *onepass.Configuration, done chan bool) {
// Load configuration from a file
client, err := onepass.NewClientWithConfig(configuration)

if err != nil {
os.Exit(1)
}

_, err = client.Authenticate(true)

if err != nil {
os.Exit(1)
}
Expand All @@ -115,7 +113,6 @@ func runSudolikeaboss() {
}

timeout, err := strconv.ParseInt(timeoutString, 10, 16)

if err != nil {
os.Exit(1)
}
Expand All @@ -141,14 +138,7 @@ func runSudolikeabossRegistration() {

go registerWithOnepassword(configuration, done)

// Timeout if necessary
select {
case <-done:
// Do nothing no need
close(done)
os.Exit(1)
}
// Close the app neatly
<-done
os.Exit(0)

}
Loading

0 comments on commit 064239a

Please sign in to comment.