Skip to content

Commit

Permalink
fix: linter issues
Browse files Browse the repository at this point in the history
  • Loading branch information
daulet committed Nov 21, 2024
1 parent 4820ceb commit 2957a32
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
2 changes: 0 additions & 2 deletions bench_server/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import (
"math/rand"
"net/http"
"strconv"
"time"

"github.com/valyala/fasthttp"
)
Expand All @@ -15,7 +14,6 @@ var serverPort = flag.Int("p", 8080, "port to use for benchmarks")

func main() {
flag.Parse()
rand.Seed(time.Now().UnixNano())
addr := "localhost:" + strconv.Itoa(*serverPort)
log.Println("Starting HTTP server on:", addr)
log.Fatalln(fasthttp.ListenAndServe(addr, func(c *fasthttp.RequestCtx) {
Expand Down
7 changes: 4 additions & 3 deletions print.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,16 @@ import (
"bytes"
"encoding/json"
"fmt"
"github.com/mattn/go-isatty"
"github.com/mattn/go-runewidth"
"math"
"os"
"regexp"
"sort"
"strconv"
"strings"
"time"

"github.com/mattn/go-isatty"
"github.com/mattn/go-runewidth"
)

var (
Expand Down Expand Up @@ -192,7 +193,7 @@ func formatFloat64(f float64) string {
return strconv.FormatFloat(f, 'f', -1, 64)
}

func (p *Printer) formatJSONReports(writer *bytes.Buffer, snapshot *SnapshotReport, isFinal bool, useSeconds bool) {
func (p *Printer) formatJSONReports(writer *bytes.Buffer, snapshot *SnapshotReport, _ bool, useSeconds bool) {
indent := 0
writer.WriteString("{\n")
indent++
Expand Down
13 changes: 7 additions & 6 deletions requester.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,7 @@ import (
"context"
"crypto/tls"
"fmt"
"github.com/valyala/fasthttp"
"github.com/valyala/fasthttp/fasthttpproxy"
"go.uber.org/automaxprocs/maxprocs"
"golang.org/x/time/rate"
"io/ioutil"
"io"
"net"
url2 "net/url"
"os"
Expand All @@ -19,6 +15,11 @@ import (
"sync/atomic"
"syscall"
"time"

"github.com/valyala/fasthttp"
"github.com/valyala/fasthttp/fasthttpproxy"
"go.uber.org/automaxprocs/maxprocs"
"golang.org/x/time/rate"
)

var (
Expand Down Expand Up @@ -259,7 +260,7 @@ func (r *Requester) DoRequest(req *fasthttp.Request, resp *fasthttp.Response, rr
rr.error = err.Error()
return
}
err = resp.BodyWriteTo(ioutil.Discard)
err = resp.BodyWriteTo(io.Discard)
if err != nil {
rr.cost = time.Since(startTime) - t1
rr.error = err.Error()
Expand Down

0 comments on commit 2957a32

Please sign in to comment.