Skip to content

Commit

Permalink
Some formatting for making lint happy
Browse files Browse the repository at this point in the history
  • Loading branch information
filimonov committed Dec 4, 2017
1 parent b366e69 commit b99fb55
Show file tree
Hide file tree
Showing 8 changed files with 22 additions and 33 deletions.
1 change: 0 additions & 1 deletion autocomplete.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package main

import (
// "github.com/davecgh/go-spew/spew"
"log"
"regexp"
"strings"
Expand Down
5 changes: 1 addition & 4 deletions chc.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,12 @@ package main

import (
"fmt"
"log"
"os"
"strings"

"github.com/jessevdk/go-flags"
"github.com/mattn/go-isatty"
// "io/ioutil"
"log"
//"math"
// "net/url"
)

const (
Expand Down
10 changes: 4 additions & 6 deletions clickhouse_http.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,18 @@ package main
import (
"bufio"
"bytes"
"context"
"encoding/json"
"errors"
"fmt"
"io"
"net"
"os"
"time"
// "log"
// "net"
"context"
"io/ioutil"
"net"
"net/http"
"net/url"
"os"
"strings"
"time"
)

func getHost() string {
Expand Down
20 changes: 7 additions & 13 deletions clickhouse_requests.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,17 @@ import (
"context"
"errors"
"fmt"
// "github.com/davecgh/go-spew/spew"
"io"
"os/signal"
"regexp"

"github.com/davecgh/go-spew/spew"
"github.com/satori/go.uuid" // generate sessionID and queryID
// "io/ioutil"
"log"
//"math"

"os"
// "net/url"

"os/signal"
"regexp"
"strconv"
"strings"
"time"

"github.com/davecgh/go-spew/spew"
"github.com/satori/go.uuid" // generate sessionID and queryID
)

var sessionID = uuid.NewV4().String()
Expand Down Expand Up @@ -95,8 +89,8 @@ func getQueryStats(queryID string) (qs queryStats, err error) {
return
}

duration_ms, _ := strconv.ParseUint(data[0][0], 10, 64)
qs.QueryDuration = time.Duration(duration_ms) * time.Millisecond
durationMs, _ := strconv.ParseUint(data[0][0], 10, 64)
qs.QueryDuration = time.Duration(durationMs) * time.Millisecond
qs.ReadRows, _ = strconv.ParseUint(data[0][1], 10, 64)
qs.ReadBytes, _ = strconv.ParseUint(data[0][2], 10, 64)
qs.WrittenRows, _ = strconv.ParseUint(data[0][3], 10, 64)
Expand Down
2 changes: 1 addition & 1 deletion helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ package main
import (
"bufio"
"io"
"strings"
"strconv"
"strings"
)

func readTabSeparated(rd io.Reader) ([][]string, error) {
Expand Down
10 changes: 5 additions & 5 deletions output.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,12 @@ import (
"bufio"
"context"
"fmt"
"github.com/mattn/go-colorable" // make colors work on windows
"io"
"os"
"os/exec"
"strings"

"github.com/mattn/go-colorable" // make colors work on windows
)

// TODO: errors
Expand Down Expand Up @@ -73,10 +74,9 @@ func (output *outputStruct) setOutfile(filename string) {
}

}
output.printServiceMsg("File "+filename + " already exists or not writable. ") // TODO
output.printServiceMsg("File " + filename + " already exists or not writable. ") // TODO
output.printServiceMsg("Will use STDOUT\n\n")


}

func (output *outputStruct) reset() {
Expand All @@ -87,7 +87,7 @@ func (output *outputStruct) reset() {
output.pagerParams = []string{}
}

func (output *outputStruct) setupOutput(cancel context.CancelFunc ) {
func (output *outputStruct) setupOutput(cancel context.CancelFunc) {
switch output.outputMode {
case omStd:
output.StdOut = output.colorableStdOut
Expand All @@ -107,7 +107,7 @@ func (output *outputStruct) setupOutput(cancel context.CancelFunc ) {
defer cancel()
err := cmd.Run()
if err != nil {
output.printServiceMsg( fmt.Sprintf("Unable to start PAGER: %s\nPager disabled, STDOUT will be used", err))
output.printServiceMsg(fmt.Sprintf("Unable to start PAGER: %s\nPager disabled, STDOUT will be used", err))
output.reset()
}
}()
Expand Down
3 changes: 2 additions & 1 deletion progressbar.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@ package main

import (
"fmt"
"github.com/chzyer/readline" // only console width used from there...
"io"
"math"
"strings"

"github.com/chzyer/readline" // only console width used from there...
)

/// http://en.wikipedia.org/wiki/ANSI_escape_code
Expand Down
4 changes: 2 additions & 2 deletions prompt_loop.go
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
package main

import (
"github.com/peterh/liner" // there is also github.com/chzyer/readline and https://github.com/Bowery/prompt
//"log"
"os"
"path/filepath"
"regexp"
"strings"

"github.com/peterh/liner" // there is also github.com/chzyer/readline and https://github.com/Bowery/prompt
)

var prompt = ":) "
Expand Down

0 comments on commit b99fb55

Please sign in to comment.