diff --git a/.circleci/config.yml b/.circleci/config.yml index cbf2e31cd..187b0c1da 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -8,7 +8,7 @@ defaultEnv: &defaultEnv docker: # specify the version - - image: docker.io/fortio/fortio.build:v58@sha256:84ab73744546c1b27e2f08143e2c080114c4f1864f760b9fca3908683259d3c4 + - image: docker.io/fortio/fortio.build:v59@sha256:735db577fe940063725cdac8dd2723875f147434f266cbdf0e6970b4fd9b1a07 working_directory: /build/fortio jobs: diff --git a/.golangci.yml b/.golangci.yml index 86686d329..895b3a9e3 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -45,14 +45,6 @@ linters-settings: - (github.com/golangci/golangci-lint/pkg/logutils.Log).FErrf enable-all: true disable-all: false - depguard: - list-type: blacklist - include-go-root: false - packages: - - github.com/sirupsen/logrus - packages-with-error-message: - # specify an error message to output when a blacklisted package is used - - github.com/sirupsen/logrus: "logging is allowed only by fortio.log" lll: # max line length, lines longer will be reported. Default is 120. # '\t' is counted as 1 character by default, and can be changed with the tab-width option @@ -115,6 +107,7 @@ linters: - cyclop - forcetypeassert - ireturn + - depguard enable-all: true disable-all: false # Must not use fast: true in newer golangci-lint or it'll just skip a bunch of linter instead of doing caching like before (!) diff --git a/Dockerfile b/Dockerfile index 24e7c8bda..ffd482140 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,5 @@ # Build the binaries in larger image -FROM docker.io/fortio/fortio.build:v58@sha256:84ab73744546c1b27e2f08143e2c080114c4f1864f760b9fca3908683259d3c4 as build +FROM docker.io/fortio/fortio.build:v59@sha256:735db577fe940063725cdac8dd2723875f147434f266cbdf0e6970b4fd9b1a07 as build WORKDIR /build COPY --chown=build:build . fortio ARG MODE=install diff --git a/Dockerfile.build b/Dockerfile.build index 6494ef2c5..793b1bf8f 100644 --- a/Dockerfile.build +++ b/Dockerfile.build @@ -1,5 +1,5 @@ # Dependencies and linters for build: -FROM golang:1.20.4@sha256:6dd5c5f8936d7d4487802fb10a77f31b1776740be0fc17ada1acb74ac958f7be +FROM golang:1.20.5@sha256:4b1fc02d16fca272e5e6e6adc98396219b43ef663a377eef4a97e881d364393f # 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 && \ diff --git a/Dockerfile.echosrv b/Dockerfile.echosrv index 864fee109..b4f85e928 100644 --- a/Dockerfile.echosrv +++ b/Dockerfile.echosrv @@ -1,5 +1,5 @@ # Build the binaries in larger image -FROM docker.io/fortio/fortio.build:v58@sha256:84ab73744546c1b27e2f08143e2c080114c4f1864f760b9fca3908683259d3c4 as build +FROM docker.io/fortio/fortio.build:v59@sha256:735db577fe940063725cdac8dd2723875f147434f266cbdf0e6970b4fd9b1a07 as build WORKDIR /build COPY . fortio RUN make -C fortio official-build-version BUILD_DIR=/build OFFICIAL_TARGET=fortio.org/fortio/echosrv diff --git a/Dockerfile.fcurl b/Dockerfile.fcurl index c8eb270bd..7e79d02cc 100644 --- a/Dockerfile.fcurl +++ b/Dockerfile.fcurl @@ -1,5 +1,5 @@ # Build the binaries in larger image -FROM docker.io/fortio/fortio.build:v58@sha256:84ab73744546c1b27e2f08143e2c080114c4f1864f760b9fca3908683259d3c4 as build +FROM docker.io/fortio/fortio.build:v59@sha256:735db577fe940063725cdac8dd2723875f147434f266cbdf0e6970b4fd9b1a07 as build WORKDIR /build COPY . fortio RUN make -C fortio official-build-version BUILD_DIR=/build OFFICIAL_TARGET=fortio.org/fortio/fcurl diff --git a/Makefile b/Makefile index 5be67c067..af95fe49a 100755 --- a/Makefile +++ b/Makefile @@ -7,7 +7,7 @@ IMAGES=echosrv fcurl # plus the combo image / Dockerfile without ext. DOCKER_PREFIX := docker.io/fortio/fortio -BUILD_IMAGE_TAG := v58@sha256:84ab73744546c1b27e2f08143e2c080114c4f1864f760b9fca3908683259d3c4 +BUILD_IMAGE_TAG := v59@sha256:735db577fe940063725cdac8dd2723875f147434f266cbdf0e6970b4fd9b1a07 BUILDX_PLATFORMS := linux/amd64,linux/arm64,linux/ppc64le,linux/s390x BUILDX_POSTFIX := ifeq '$(shell echo $(BUILDX_PLATFORMS) | awk -F "," "{print NF-1}")' '0' diff --git a/Webtest.sh b/Webtest.sh index 4addefca2..7e6ac04e0 100755 --- a/Webtest.sh +++ b/Webtest.sh @@ -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:v58@sha256:84ab73744546c1b27e2f08143e2c080114c4f1864f760b9fca3908683259d3c4 sleep 120) +DOCKERCURLID=$(docker run -d -v $TEST_CERT_VOL --net host --name $DOCKERSECVOLNAME docker.io/fortio/fortio.build:v59@sha256:735db577fe940063725cdac8dd2723875f147434f266cbdf0e6970b4fd9b1a07 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 diff --git a/periodic/periodic.go b/periodic/periodic.go index 95c6baa97..18a5d75fe 100644 --- a/periodic/periodic.go +++ b/periodic/periodic.go @@ -404,7 +404,7 @@ func (r *periodicRunner) runQPSSetup(extra string) (requestedDuration string, re // Always print that as we need ^C to interrupt, in that case the user need to notice _, _ = fmt.Fprintf(r.Out, "Starting at %g qps with %d thread(s) [gomax %d] until interrupted%s\n", r.QPS, r.NumThreads, runtime.GOMAXPROCS(0), extra) - return + return //nolint:nakedret // it's fine/cleaner to not repeat all the parameters we just set/we return. } // else: requestedDuration = fmt.Sprint(r.Duration) diff --git a/rapi/data.go b/rapi/data.go index 6c17ebfcc..621eb1ba9 100644 --- a/rapi/data.go +++ b/rapi/data.go @@ -80,7 +80,7 @@ func SendTSVDataIndex(urlPrefix string, w http.ResponseWriter) { useCache := (info.ModTime() == gTSVCache.cachedDirTime) && (len(gTSVCache.cachedResult) > 0) if !useCache { var b bytes.Buffer - b.Write([]byte("TsvHttpData-1.0\n")) + b.WriteString("TsvHttpData-1.0\n") for _, e := range DataList() { fname := e + ".json" f, err := os.Open(path.Join(dataDir, fname)) @@ -96,13 +96,13 @@ func SendTSVDataIndex(urlPrefix string, w http.ResponseWriter) { log.Errf("Copy/read error for %s: %v", fname, err) continue } - b.Write([]byte(urlPrefix)) - b.Write([]byte(fname)) - b.Write([]byte("\t")) - b.Write([]byte(strconv.FormatInt(sz, 10))) - b.Write([]byte("\t")) - b.Write([]byte(base64.StdEncoding.EncodeToString(h.Sum(nil)))) - b.Write([]byte("\n")) + b.WriteString(urlPrefix) + b.WriteString(fname) + b.WriteString("\t") + b.WriteString(strconv.FormatInt(sz, 10)) + b.WriteString("\t") + b.WriteString(base64.StdEncoding.EncodeToString(h.Sum(nil))) + b.WriteString("\n") } gTSVCache.cachedDirTime = info.ModTime() gTSVCache.cachedResult = b.Bytes() diff --git a/release/Dockerfile.in b/release/Dockerfile.in index cd5338c08..7faa614ca 100644 --- a/release/Dockerfile.in +++ b/release/Dockerfile.in @@ -1,5 +1,5 @@ # Concatenated after ../Dockerfile to create the tgz -FROM docker.io/fortio/fortio.build:v58@sha256:84ab73744546c1b27e2f08143e2c080114c4f1864f760b9fca3908683259d3c4 as stage +FROM docker.io/fortio/fortio.build:v59@sha256:735db577fe940063725cdac8dd2723875f147434f266cbdf0e6970b4fd9b1a07 as stage ARG archs="amd64 arm64 ppc64le s390x" ENV archs=${archs} # Build image defaults to build user, switch back to root for