Skip to content

Commit

Permalink
go fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
mutantmonkey committed Oct 9, 2015
1 parent 87a7c35 commit 24f071f
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 12 deletions.
10 changes: 5 additions & 5 deletions linx.go
Original file line number Diff line number Diff line change
Expand Up @@ -179,13 +179,13 @@ func unlinx(config *Config, url string, deleteKey string) bool {
func main() {
config := &Config{}
var flags struct {
deleteKey string
deleteKey string
deleteMode bool
ttl int
ttl int
configPath string
server string
proxy string
uploadLog string
server string
proxy string
uploadLog string
}

defaultConfigPath, err := xdg.ConfigFile("golinx/config.yml")
Expand Down
15 changes: 8 additions & 7 deletions progress.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import (

const termWidth = 80
const updateInterval = time.Second / 10

var clearBuf = bytes.Repeat([]byte{' '}, termWidth)

func init() {
Expand All @@ -20,18 +21,18 @@ func init() {
type ProgressReader struct {
output io.Writer
reader io.Reader
total int64
read chan int
label string
total int64
read chan int
label string
}

func NewProgressReader(label string, r io.Reader, size int64) io.ReadCloser {
pr := &ProgressReader{
output: os.Stderr,
reader: r,
total: size,
read: make(chan int),
label: label,
total: size,
read: make(chan int),
label: label,
}

go pr.update()
Expand All @@ -55,7 +56,7 @@ func (pr *ProgressReader) clearProgress() {
}

func (pr *ProgressReader) printProgress(n int64) {
percent := float64(n * 100) / float64(pr.total)
percent := float64(n*100) / float64(pr.total)
fmt.Fprintf(pr.output, "\r%-40v %7.2f%%", pr.label, percent)
}

Expand Down

0 comments on commit 24f071f

Please sign in to comment.