Skip to content

Commit

Permalink
event.go: format startTime
Browse files Browse the repository at this point in the history
Instead of fmt.Sprintf("%d", startTime) use strconv.FormatInt(startTime, 10) for a better performance
  • Loading branch information
stokito committed Jan 2, 2021
1 parent ef7c0a3 commit d7c687e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions event.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ package docker
import (
"encoding/json"
"errors"
"fmt"
"io"
"math"
"net"
"net/http"
"net/http/httputil"
"strconv"
"sync"
"sync/atomic"
"time"
Expand Down Expand Up @@ -346,7 +346,7 @@ func (eventState *eventMonitoringState) updateLastSeen(e *APIEvents) {
func (c *Client) eventHijack(opts EventsOptions, startTime int64, eventChan chan *APIEvents, errChan chan error) error {
// on reconnect override initial Since with last event seen time
if startTime != 0 {
opts.Since = fmt.Sprintf("%d", startTime)
opts.Since = strconv.FormatInt(startTime, 10)
}
uri := "/events?" + queryString(opts)
protocol := c.endpointURL.Scheme
Expand Down

0 comments on commit d7c687e

Please sign in to comment.