From f76a26813d4617e0430d611ffc0bcbc03e18f9fb Mon Sep 17 00:00:00 2001 From: Chris Hager Date: Wed, 25 Sep 2024 11:38:47 +0200 Subject: [PATCH] various minor updates and cleanup (#37) --- .github/workflows/checks.yml | 6 +++--- .golangci.yaml | 13 +++---------- Makefile | 2 +- README.md | 2 +- cli.dockerfile | 2 +- go.mod | 2 +- httpserver.dockerfile | 2 +- metrics/README.md | 7 +++++++ 8 files changed, 18 insertions(+), 18 deletions(-) diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml index f14fdde..11aa09d 100644 --- a/.github/workflows/checks.yml +++ b/.github/workflows/checks.yml @@ -14,7 +14,7 @@ jobs: - name: Set up Go uses: actions/setup-go@v3 with: - go-version: ^1.21 + go-version: ^1.22 id: go - name: Check out code into the Go module directory @@ -30,7 +30,7 @@ jobs: - name: Set up Go uses: actions/setup-go@v3 with: - go-version: ^1.21 + go-version: ^1.22 id: go - name: Check out code into the Go module directory @@ -40,7 +40,7 @@ jobs: run: go install mvdan.cc/gofumpt@v0.4.0 - name: Install staticcheck - run: go install honnef.co/go/tools/cmd/staticcheck@v0.4.2 + run: go install honnef.co/go/tools/cmd/staticcheck@2024.1.1 - name: Install golangci-lint run: go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.60.3 diff --git a/.golangci.yaml b/.golangci.yaml index bdb9e65..fc4d5cf 100644 --- a/.golangci.yaml +++ b/.golangci.yaml @@ -18,7 +18,6 @@ linters: - nlreturn - noctx - nonamedreturns - - nosnakecase - paralleltest - revive - testpackage @@ -26,10 +25,9 @@ linters: - varnamelen - wrapcheck - wsl - - deadcode - - varcheck - exhaustruct - depguard + - err113 # # Disabled because of generics: @@ -37,18 +35,13 @@ linters: - contextcheck - rowserrcheck - sqlclosecheck - - structcheck - wastedassign # # Disabled because deprecated: # - - exhaustivestruct - - golint - - ifshort - - interfacer - - maligned - - scopelint + - execinquery + - exportloopref linters-settings: # diff --git a/Makefile b/Makefile index f59b05b..5c9eb3d 100644 --- a/Makefile +++ b/Makefile @@ -47,7 +47,7 @@ lint: ## Run linters go vet ./... staticcheck ./... golangci-lint run - nilaway ./... + # nilaway ./... .PHONY: fmt fmt: ## Format the code diff --git a/README.md b/README.md index c71fc88..0c92c85 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # go-template [![Goreport status](https://goreportcard.com/badge/github.com/flashbots/go-template)](https://goreportcard.com/report/github.com/flashbots/go-template) -[![Test status](https://github.com/flashbots/go-template/workflows/Checks/badge.svg?branch=main)](https://github.com/flashbots/go-template/actions?query=workflow%3A%22Checks%22) +[![Test status](https://github.com/flashbots/go-template/actions/workflows/checks.yml/badge.svg?branch=main)](https://github.com/flashbots/go-template/actions?query=workflow%3A%22Checks%22) Toolbox and building blocks for new Go projects, to get started quickly and right-footed! diff --git a/cli.dockerfile b/cli.dockerfile index 3b00190..ec24cbf 100644 --- a/cli.dockerfile +++ b/cli.dockerfile @@ -1,5 +1,5 @@ # syntax=docker/dockerfile:1 -FROM golang:1.21 AS builder +FROM golang:1.23 AS builder ARG VERSION WORKDIR /build ADD go.mod /build/ diff --git a/go.mod b/go.mod index e1340b8..c021ba6 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/flashbots/go-template -go 1.21 +go 1.22 require ( github.com/flashbots/go-utils v0.6.1-0.20240610084140-4461ab748667 diff --git a/httpserver.dockerfile b/httpserver.dockerfile index 0fed6bb..83184ce 100644 --- a/httpserver.dockerfile +++ b/httpserver.dockerfile @@ -1,5 +1,5 @@ # syntax=docker/dockerfile:1 -FROM golang:1.21 AS builder +FROM golang:1.23 AS builder ARG VERSION WORKDIR /build ADD go.mod /build/ diff --git a/metrics/README.md b/metrics/README.md index 2a7a7db..27fadeb 100644 --- a/metrics/README.md +++ b/metrics/README.md @@ -1,5 +1,12 @@ # metrics +This example metrics module uses the OpenTelemetry package. + +A solid alternative is [VictoriaMetrics](https://github.com/VictoriaMetrics/VictoriaMetrics), see an example +implementation here: https://github.com/flashbots/mev-share-node/blob/main/metrics/metrics.go + +--- + Introduction: - https://opentelemetry.io/docs/languages/go/instrumentation/