8000 Switching to go 1.23(.3) by ldemailly · Pull Request #997 · fortio/fortio · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Switching to go 1.23(.3) #997

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Nov 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ defaultEnv:
&defaultEnv
docker:
# specify the version
- image: docker.io/fortio/fortio.build:v76@sha256:252248e117d0d41fad25aa7c216e98ce516a2754d73f9241df537a2c8982b0c3
- image: docker.io/fortio/fortio.build:v77@sha256:03af2e7202d5364fb3424c9ef28f372702081ee809b7f8dfbb2a1b649b0b4c2c
working_directory: /build/fortio

jobs:
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Build the binaries in larger image
FROM docker.io/fortio/fortio.build:v76@sha256:252248e117d0d41fad25aa7c216e98ce516a2754d73f9241df537a2c8982b0c3 as build
FROM docker.io/fortio/fortio.build:v77@sha256:03af2e7202d5364fb3424c9ef28f372702081ee809b7f8dfbb2a1b649b0b4c2c as build
WORKDIR /build
COPY --chown=build:build . fortio
ARG MODE=install
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile.build
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Dependencies and linters for build:
FROM golang:1.22.8@sha256:628529a29f130a8ab336b994be99d134ce98cd23b8f2052d8995678681e97ca2
FROM golang:1.23.3@sha256:8956c08c8129598db36e92680d6afda0079b6b32b93c2c08260bf6fa75524e07
# Need gcc for -race test (and some linters though those work with CGO_ENABLED=0)
RUN apt-get -y update && \
apt-get --no-install-recommends -y upgrade && \
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile.echosrv
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Build the binaries in larger image
FROM docker.io/fortio/fortio.build:v76@sha256:252248e117d0d41fad25aa7c216e98ce516a2754d73f9241df537a2c8982b0c3 as build
FROM docker.io/fortio/fortio.build:v77@sha256:03af2e7202d5364fb3424c9ef28f372702081ee809b7f8dfbb2a1b649b0b4c2c as build
WORKDIR /build
COPY . fortio
RUN make -C fortio official-build-version BUILD_DIR=/build OFFICIAL_TARGET=fortio.org/fortio/echosrv
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile.fcurl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Build the binaries in larger image
FROM docker.io/fortio/fortio.build:v76@sha256:252248e117d0d41fad25aa7c216e98ce516a2754d73f9241df537a2c8982b0c3 as build
FROM docker.io/fortio/fortio.build:v77@sha256:03af2e7202d5364fb3424c9ef28f372702081ee809b7f8dfbb2a1b649b0b4c2c as build
WORKDIR /build
COPY . fortio
RUN make -C fortio official-build-version BUILD_DIR=/build OFFICIAL_TARGET=fortio.org/fortio/fcurl
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
IMAGES=echosrv fcurl # plus the combo image / Dockerfile without ext.

DOCKER_PREFIX := docker.io/fortio/fortio
BUILD_IMAGE_TAG := v76@sha256:252248e117d0d41fad25aa7c216e98ce516a2754d73f9241df537a2c8982b0c3
BUILD_IMAGE_TAG := v77@sha256:03af2e7202d5364fb3424c9ef28f372702081ee809b7f8dfbb2a1b649b0b4c2c
BUILDX_PLATFORMS := linux/amd64,linux/arm64,linux/ppc64le,linux/s390x
BUILDX_POSTFIX :=
ifeq '$(shell echo $(BUILDX_PLATFORMS) | awk -F "," "{print NF-1}")' '0'
Expand Down
2 changes: 1 addition & 1 deletion Webtest.sh
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ fi
PPROF_URL="$BASE_URL/debug/pprof/heap?debug=1"
$CURL "$PPROF_URL" | grep -i TotalAlloc # should find this in memory profile
# creating dummy container to hold a volume for test certs due to remote docker bind mount limitation.
DOCKERCURLID=$(docker run -d -v $TEST_CERT_VOL --net host --name $DOCKERSECVOLNAME docker.io/fortio/fortio.build:v76@sha256:252248e117d0d41fad25aa7c216e98ce516a2754d73f9241df537a2c8982b0c3 sleep 120)
DOCKERCURLID=$(docker run -d -v $TEST_CERT_VOL --net host --name $DOCKERSECVOLNAME docker.io/fortio/fortio.build:v77@sha256:03af2e7202d5364fb3424c9ef28f372702081ee809b7f8dfbb2a1b649b0b4c2c sleep 120)
# while we have something with actual curl binary do
# Test for h2c upgrade (#562)
docker exec $DOCKERSECVOLNAME /usr/bin/curl -v --http2 -m 10 -d foo42 http://localhost:8080/debug | tee >(cat 1>&2) | grep foo42
Expand Down
2 changes: 1 addition & 1 deletion cli/fortio_main.go
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,7 @@
mcfg := fhttp.MultiServerConfig{Serial: *multiSerialFlag}
n := len(s) - 1
mcfg.Targets = make([]fhttp.TargetConf, n)
for i := 0; i < n; i++ {
for i := range n {

Check warning on line 340 in cli/fortio_main.go

View check run for this annotation

Codecov / codecov/patch

cli/fortio_main.go#L340

Added line #L340 was not covered by tests
mcfg.Targets[i].Destination = s[i+1]
mcfg.Targets[i].MirrorOrigin = *mirrorOriginFlag
}
Expand Down
4 changes: 2 additions & 2 deletions fgrpc/grpcrunner.go
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ func RunGRPCTest(o *GRPCRunnerOptions) (*GRPCRunnerResults, error) {
var conn *grpc.ClientConn
var err error
ts := time.Now().UnixNano()
for i := 0; i < numThreads; i++ {
for i := range numThreads {
r.Options().Runners[i] = &grpcstate[i]
newConn := i%o.Streams == 0
if newConn {
Expand Down Expand Up @@ -259,7 +259,7 @@ func RunGRPCTest(o *GRPCRunnerOptions) (*GRPCRunnerResults, error) {
// Numthreads may have reduced
numThreads = r.Options().NumThreads
keys := []string{}
for i := 0; i < numThreads; i++ {
for i := range numThreads {
// Q: is there some copying each time stats[i] is used?
for k := range grpcstate[i].RetCodes {
if _, exists := total.RetCodes[k]; !exists {
Expand Down
6 changes: 3 additions & 3 deletions fhttp/http_forwarder.go
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ func (mcfg *MultiServerConfig) TeeParallelHandler(w http.ResponseWriter, r *http
numTargets := len(mcfg.Targets)
ba := make([]bytes.Buffer, numTargets)
sa := make([]int, numTargets)
for i := 0; i < numTargets; i++ {
for i := range numTargets {
req := setupRequest(r, i, mcfg.Targets[i], data)
if req == nil {
continue
Expand All @@ -239,7 +239,7 @@ func (mcfg *MultiServerConfig) TeeParallelHandler(w http.ResponseWriter, r *http
wg.Wait()
// Get overall status only ok if all OK, first non ok sets status
status := http.StatusOK
for i := 0; i < numTargets; i++ {
for i := range numTargets {
if sa[i] != http.StatusOK {
status = sa[i]
break
Expand All @@ -250,7 +250,7 @@ func (mcfg *MultiServerConfig) TeeParallelHandler(w http.ResponseWriter, r *http
}
w.WriteHeader(status)
// Send all the data back to back
for i := 0; i < numTargets; i++ {
for i := range numTargets {
bw, err := w.Write(ba[i].Bytes())
log.Debugf("For %d, wrote %d bytes - status %d", i, bw, sa[i])
if err != nil {
Expand Down
4 changes: 2 additions & 2 deletions fhttp/http_forwarder_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import (
func TestMultiProxy(t *testing.T) {
_, debugAddr := ServeTCP("0", "/debug")
urlBase := fmt.Sprintf("localhost:%d/", debugAddr.Port)
for i := 0; i < 2; i++ {
for i := range 2 {
serial := (i == 0)
mcfg := MultiServerConfig{Serial: serial}
mcfg.Targets = []TargetConf{
Expand Down Expand Up @@ -97,7 +97,7 @@ func TestMultiProxy(t *testing.T) {
}

func TestMultiProxyErrors(t *testing.T) {
for i := 0; i < 2; i++ {
for i := range 2 {
serial := (i == 0)
mcfg := MultiServerConfig{Serial: serial}
// No scheme in url to cause error
Expand Down
16 changes: 8 additions & 8 deletions fhttp/http_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -203,9 +203,9 @@ func TestFoldFind2(t *testing.T) {
var needle [1]byte
// we don't mind for these to map to each other in exchange for 30% perf gain
okExceptions := "@[\\]^_`{|}~"
for i := 0; i < 127; i++ { // skipping 127 too, matches _
for i := range 127 { // skipping 127 too, matches _
haystack[0] = byte(i)
for j := 0; j < 128; j++ {
for j := range 128 {
needle[0] = byte(j)
sh := string(haystack[:])
sn := string(needle[:])
Expand Down Expand Up @@ -443,7 +443,7 @@ func TestGenerateStatusDistribution(t *testing.T) {
log.SetLogLevel(log.Info)
str := "501:20,502:30,503:0.5"
m := make(map[int]int)
for i := 0; i < 10000; i++ {
for range 10000 {
m[generateStatus(str)]++
}
if len(m) != 4 {
Expand Down Expand Up @@ -620,7 +620,7 @@ func TestPayloadWithStdClientAndClosedSocket(t *testing.T) {
opts.Payload = payload
cli, _ := NewClient(opts)
ctx := context.Background()
for i := 0; i < 3; i++ {
for range 3 {
code, body, header := cli.Fetch(ctx)

if code != 200 {
Expand Down Expand Up @@ -1074,10 +1074,10 @@ func TestManyUUIDsFastClient(t *testing.T) {
m, a := DynamicHTTPServer(false)
m.HandleFunc("/", ValidateManyUUID)
url := fmt.Sprintf("http://localhost:%d/{uuid}/{uuid}?uuid={uuid}&uuid2={uuid}", a.Port)
for i := 0; i < 10; i++ {
for range 10 {
o := HTTPOptions{URL: url, DisableFastClient: false}
client, _ := NewClient(&o)
for j := 0; j < 3; j++ {
for range 3 {
code, data, header := client.Fetch(context.Background())
t.Logf("TestPayloadSize result code %d, data len %d, headerlen %d", code, len(data), header)
if code != 200 {
Expand Down Expand Up @@ -1160,10 +1160,10 @@ func TestManyUUIDsClient(t *testing.T) {
m, a := CEB7 DynamicHTTPServer(false)
m.HandleFunc("/", ValidateManyUUID)
url := fmt.Sprintf("http://localhost:%d/{uuid}/{uuid}?uuid={uuid}&uuid2={uuid}", a.Port)
for i := 0; i < 10; i++ {
for range 10 {
o := HTTPOptions{URL: url, DisableFastClient: true}
client, _ := NewClient(&o)
for j := 0; j < 3; j++ {
for range 3 {
code, data, header := client.Fetch(context.Background())
t.Logf("TestPayloadSize result code %d, data len %d, headerlen %d", code, len(data), header)
if code != 200 {
Expand Down
7 changes: 3 additions & 4 deletions fhttp/httprunner.go
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ func RunHTTPTest(o *HTTPRunnerOptions) (*HTTPRunnerResults, error) {
// First build all the clients sequentially. This ensures we do not have data races when
// constructing requests.
ctx := context.Background()
for i := 0; i < numThreads; i++ {
for i := range numThreads {
r.Options().Runners[i] = &httpstate[i]
// Temp mutate the option so each client gets a logging id
o.HTTPOptions.ID = i
Expand Down Expand Up @@ -179,8 +179,7 @@ func RunHTTPTest(o *HTTPRunnerOptions) (*HTTPRunnerResults, error) {
}
if o.Exactly <= 0 && !o.SequentialWarmup {
warmup := errgroup{}
for i := 0; i < numThreads; i++ {
i := i
for i := range numThreads {
warmup.Go(func() error {
code, dataLen, headerSize := httpstate[i].client.StreamFetch(ctx)
if !o.AllowInitialErrors && !codeIsOK(code) {
Expand Down Expand Up @@ -232,7 +231,7 @@ func RunHTTPTest(o *HTTPRunnerOptions) (*HTTPRunnerResults, error) {
// But we also must cleanup all the created clients.
keys := []int{}
fmt.Fprintf(out, "# Socket and IP used for each connection:\n")
for i := 0; i < numThreads; i++ {
for i := range numThreads {
// Get the report on the IP address each thread use to send traffic
occurrence, connStats := httpstate[i].client.GetIPAddress()
currentSocketUsed := connStats.Count
Expand Down
2 changes: 1 addition & 1 deletion fhttp/httprunner_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -537,7 +537,7 @@ func TestConnectionReuseRange(t *testing.T) {
expectedSocketReuse := int64(2)
opts.ConnReuseRange = [2]int{5, 9}
// Check a few times that despite the range and random 2-9 we still always get 2 connections
for i := 0; i < 5; i++ {
for range 5 {
res, err := RunHTTPTest(&opts)
if err != nil {
t.Error(err)
Expand Down
2 changes: 1 addition & 1 deletion fnet/network.go
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ func ChangeMaxPayloadSize(newMaxPayloadSize int) {
Payload = make([]byte, MaxPayloadSize)
// One shared and 'constant' (over time) but pseudo random content for payload
// (to defeat compression).
_, err := rand.Read(Payload) //nolint:gosec,staticcheck // We don't need crypto strength here, just low cpu and speed
_, err := rand.Read(Payload) //nolint:staticcheck,gosec // We don't need crypto strength here, just low cpu and speed
if err != nil {
log.Errf("Error changing payload size, read for %d random payload failed: %v", newMaxPayloadSize, err)
}
Expand Down
2 changes: 1 addition & 1 deletion fnet/network_norace_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ func TestTCPEchoServerEOF(t *testing.T) {
// quite brittle but somehow we can get read: connection reset by peer and write: broken pipe
// with these timings (!)
ctx := context.Background()
for i := 0; i < 10; i++ {
for i := range 10 {
eofStopFlag := (i%2 == 0)
in := io.NopCloser(strings.NewReader(strings.Repeat("x", 50000)))
var out ErroringWriter
Expand Down
4 changes: 1 addition & 3 deletions fnet/network_test.go
Original file line number Diff line number Diff line change
@@ -126,7 +126,6 @@ func TestResolveDestination(t *testing.T) {
}
ctx := context.Background()
for _, tt := range tests {
tt := tt // pin
t.Run(tt.name, func(t *testing.T) {
got, _ := fnet.TCPResolveDestination(ctx, tt.destination)
gotStr := ""
Expand Down Expand Up @@ -160,7 +159,6 @@ func TestUDPResolveDestination(t *testing.T) {
}
ctx := context.Background()
for _, tt := range tests {
tt := tt // pin
t.Run(tt.name, func(t *testing.T) {
got, _ := fnet.UDPResolveDestination(ctx, tt.destination)
gotStr := ""
Expand Down Expand Up @@ -577,7 +575,7 @@ func TestDNSCacheConcurrency(t *testing.T) {
n := 20
wg.Add(n)
ctx := context.Background()
for i := 0; i < n; i++ {
for range n {
go func() {
fnet.Resolve(ctx, "localhost", "80")
wg.Done()
Expand Down
8 changes: 5 additions & 3 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
module fortio.org/fortio

// As a library the current version of fortio works with 1.18 (first version with generics) but tests use 1.19 features
// Note we will switch soon to 1.22 for the linters, using 1.21 is neeed when using toolchain below and because of grpc update
go 1.21
// And we're started to use the new features in 1.22 and 1.23
// (in part forced by grpc). we force 1.22.3 because 1.23.2 has pretty severe bug (macos) even though I think "1.23" with
// no patch level would be better for the go.mod file.
go 1.23.3

// When needed, ie to force download of July 2nd 2024 go security and bug fix release,
// as 1.22.5 docker images were not there yet and ditto for action/setup-go
Expand All @@ -22,7 +24,7 @@ require (
github.com/golang/protobuf v1.5.4
github.com/google/uuid v1.6.0
golang.org/x/net v0.31.0
google.golang.org/grpc v1.67.1
google.golang.org/grpc v1.68.0
)

// Local dev of dependencies changes
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ golang.org/x/tools v0.24.0 h1:J1shsA93PJUEVaUSaay7UXAyE8aimq3GW0pjlolpa24=
golang.org/x/tools v0.24.0/go.mod h1:YhNqVBIfWHdzvTLs0d8LCuMhkKUgSUKldakyV7W/WDQ=
google.golang.org/genproto/googleapis/rpc v0.0.0-20240903143218-8af14fe29dc1 h1:pPJltXNxVzT4pK9yD8vR9X75DaWYYmLGMsEvBfFQZzQ=
google.golang.org/genproto/googleapis/rpc v0.0.0-20240903143218-8af14fe29dc1/go.mod h1:UqMtugtsSgubUsoxbuAoiCXvqvErP7Gf0so0mK9tHxU=
google.golang.org/grpc v1.67.1 h1:zWnc1Vrcno+lHZCOofnIMvycFcc0QRGIzm9dhnDX68E=
google.golang.org/grpc v1.67.1/go.mod h1:1gLDyUQU7CTLJI90u3nXZ9ekeghjeM7pTDZlqFNg2AA=
google.golang.org/grpc v1.68.0 h1:aHQeeJbo8zAkAa3pRzrVjZlbz6uSfeOXlJNQM0RAbz0=
google.golang.org/grpc v1.68.0/go.mod h1:fmSPC5AsjSBCK54MyHRx48kpOti1/jRfOlwEWywNjWA=
google.golang.org/protobuf v1.34.2 h1:6xV6lTsCfpGD21XK49h7MhtcApnLqkfYgPcdHftf6hg=
google.golang.org/protobuf v1.34.2/go.mod h1:qYOHts0dSfpeUzUFpOMr/WGzszTmLH+DiWniOlNbLDw=
6 changes: 3 additions & 3 deletions jrpc/jrpc_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -447,7 +447,7 @@ func TestJPRCSlices(t *testing.T) {
n = 42 // for testing of GetArray
}
resp := make([]SliceOneResponse, n)
for i := 0; i < n; i++ {
for i := range n {
resp[i] = SliceOneResponse{
Index: i,
Data: fmt.Sprintf("data %d", i),
Expand All @@ -469,7 +469,7 @@ func TestJPRCSlices(t *testing.T) {
if len(slice) != 10 {
t.Errorf("expected 10 results, got %d", len(slice))
}
for i := 0; i < len(slice); i++ {
for i := range slice {
el := slice[i]
if el.Index != i {
t.Errorf("expected index %d, got %d", i, el.Index)
Expand All @@ -485,7 +485,7 @@ func TestJPRCSlices(t *testing.T) {
if len(slice) != 42 {
t.Errorf("expected 42 results, got %d", len(slice))
}
for i := 0; i < len(slice); i++ {
for i := range slice {
el := slice[i]
if el.Index != i {
t.Errorf("expected index %d, got %d", i, el.Index)
Expand Down
6 changes: 3 additions & 3 deletions periodic/periodic.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ func (r *RunnerOptions) MakeRunners(rr Runnable) {
log.Infof("Resizing runners from %d to %d", len(r.Runners), r.NumThreads)
r.Runners = make([]Runnable, r.NumThreads)
}
for i := 0; i < r.NumThreads; i++ {
for i := range r.NumThreads {
r.Runners[i] = rr
}
}
Expand Down Expand Up @@ -549,7 +549,7 @@ func (r *periodicRunner) Run() RunnerResults {
} else {
var wg sync.WaitGroup
var fDs, eDs, sDs []*stats.Histogram
for t := 0; t < r.NumThreads; t++ {
for t := range r.NumThreads {
durP := functionDuration.Clone()
errP := errorsDuration.Clone()
sleepP := sleepTime.Clone()
Expand All @@ -568,7 +568,7 @@ func (r *periodicRunner) Run() RunnerResults {
}(ThreadID(t), durP, errP, sleepP)
}
wg.Wait()
for t := 0; t < r.NumThreads; t++ {
for t := range r.NumThreads {
functionDuration.Transfer(fDs[t])
errorsDuration.Transfer(eDs[t])
sleepTime.Transfer(sDs[t])
Expand Down
2 changes: 1 addition & 1 deletion periodic/periodic_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -570,7 +570,7 @@ func TestGetJitter(t *testing.T) {
t.Errorf("getJitter < 5 got %v instead of expected 0", d)
}
sum := 0.
for i := 0; i < 1000; i++ {
for range 1000 {
d = getJitter(6)
a := math.Abs(float64(d))
// only valid values are -1, 0, 1
Expand Down
2 changes: 1 addition & 1 deletion release/Dockerfile.in
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Concatenated after ../Dockerfile to create the tgz
FROM docker.io/fortio/fortio.build:v76@sha256:252248e117d0d41fad25aa7c216e98ce516a2754d73f9241df537a2c8982b0c3 as stage
FROM docker.io/fortio/fortio.build:v77@sha256:03af2e7202d5364fb3424c9ef28f372702081ee809b7f8dfbb2a1b649b0b4c2c as stage
ARG archs="amd64 arm64 ppc64le s390x"
ENV archs=${archs}
# Build image defaults to build user, switch back to root for
Expand Down
2 changes: 1 addition & 1 deletion stats/stats.go
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ func init() {
log.Fatalf("Bug boundary maxArrayValue=%d not found in bucket list %v", maxArrayValue, histogramBucketValues)
}
idx := 0
for i := int32(0); i < maxArrayValue; i++ {
for i := range maxArrayValue {
if i >= histogramBucketValues[idx] {
idx++
}
Expand Down
4 changes: 2 additions & 2 deletions stats/stats_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ func CheckGenericHistogramDataProperties(t *testing.T, e *HistogramData) {
// All buckets in order
var prev Bucket
var sum int64
for i := 0; i < n; i++ {
for i := range n {
b := e.Data[i]
assert.Assert(t, b.Start <= b.End, "End %f should always be after Start %f", b.End, b.Start)
assert.Assert(t, b.Count > 0, "Every exported bucket should have data")
Expand Down Expand Up @@ -375,7 +375,7 @@ func TestHistogramNegativeOffset(t *testing.T) {
func TestHistogramExportRandom(t *testing.T) {
seed := time.Now().UnixNano()
r := rand.New(rand.NewSource(seed))
for i := 0; i < NumRandomHistogram; i++ {
for i := range NumRandomHistogram {
// offset [-500,500[ divisor ]0,100]
offset := (r.Float64() - 0.5) * 1000
div := 100 * (1 - r.Float64())
Expand Down
Loading
0