style: change space to tab for goreport

This commit is contained in:
Adrien Waksberg 2019-08-31 19:18:35 +02:00
parent 30ada1a1fc
commit 3f9d4850b6
13 changed files with 853 additions and 842 deletions

View file

@ -17,6 +17,7 @@ Which is based on [Keep A Changelog](http://keepachangelog.com/)
- Export in a file
- Use RandomString function for wallet's salt
- Search is case insensite
- change space to tab for goreport
## v1.1.0 - 2019-07-23

View file

@ -1,8 +1,9 @@
# gpm: Go Passwords Manager
[![Version](https://img.shields.io/badge/latest_version-1.1.0-green.svg)](https://git.yaegashi.fr/nishiki/gpm/releases)
[![License](https://img.shields.io/badge/license-Apache--2.0-blue.svg)](https://git.yaegashi.fr/nishiki/gpm/src/branch/master/LICENSE)
[![Build Status](https://travis-ci.org/nishiki/gpm.svg?branch=master)](https://travis-ci.org/nishiki/gpm)
[![GoReport](https://goreportcard.com/badge/git.yaegashi.fr/nishiki/gpm)](https://goreportcard.com/report/git.yaegashi.fr/nishiki/gpm)
[![License](https://img.shields.io/badge/license-Apache--2.0-blue.svg)](https://git.yaegashi.fr/nishiki/gpm/src/branch/master/LICENSE)
gpm is passwords manager write in go and use AES-256 to encrypt the wallets

View file

@ -17,13 +17,13 @@ package gpm
import (
"bufio"
"fmt"
"github.com/atotto/clipboard"
"github.com/olekukonko/tablewriter"
"golang.org/x/crypto/ssh/terminal"
"io/ioutil"
"os"
"strconv"
"syscall"
"github.com/atotto/clipboard"
"github.com/olekukonko/tablewriter"
"golang.org/x/crypto/ssh/terminal"
)
// Cli contain config and wallet to use
@ -40,7 +40,11 @@ func (c *Cli) printEntries(entries []Entry) {
tables = make(map[string]*tablewriter.Table)
for i, entry := range entries {
if entry.OTP == "" { otp = "" } else { otp = "X" }
if entry.OTP == "" {
otp = ""
} else {
otp = "X"
}
if _, present := tables[entry.Group]; present == false {
tables[entry.Group] = tablewriter.NewWriter(os.Stdout)
tables[entry.Group].SetHeader([]string{"", "Name", "URI", "User", "OTP", "Comment"})

View file

@ -16,9 +16,9 @@ package gpm
import (
"crypto/aes"
"crypto/sha512"
"crypto/cipher"
"crypto/rand"
"crypto/sha512"
"encoding/base64"
"io"
mrand "math/rand"
@ -89,9 +89,15 @@ func RandomString(length int, letter bool, digit bool, special bool) string {
chars := ""
randomString := make([]byte, length)
if letter { chars = chars + letters }
if digit { chars = chars + digits }
if special { chars = chars + specials }
if letter {
chars = chars + letters
}
if digit {
chars = chars + digits
}
if special {
chars = chars + specials
}
if !letter && !digit && !special {
chars = digits + letters
}

View file

@ -16,8 +16,8 @@ package gpm
import (
"fmt"
"time"
"net/url"
"time"
"github.com/pquerna/otp/totp"
)

View file

@ -15,8 +15,8 @@
package gpm
import (
"fmt"
"flag"
"fmt"
"os"
)

View file

@ -20,12 +20,11 @@ import (
"io/ioutil"
"os"
"regexp"
"time"
"sort"
"strings"
"time"
)
// WalletFile contains the data in file
type WalletFile struct {
Salt string

View file

@ -2,8 +2,8 @@ package gpm
import (
"fmt"
"os"
"io/ioutil"
"os"
"testing"
)