From 87ad8437fc1e28280e8c5c5fdcb41e0a8904a855 Mon Sep 17 00:00:00 2001 From: PrometheusBot Date: Fri, 23 Dec 2022 10:59:32 +0100 Subject: [PATCH] Synchronize common files from prometheus/prometheus (#3191) * Update common Prometheus files * cluster: fix formatting Signed-off-by: prombot Signed-off-by: Simon Pasquier Co-authored-by: Simon Pasquier --- Makefile.common | 2 +- cluster/advertise.go | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/Makefile.common b/Makefile.common index e358db69..1985fcde 100644 --- a/Makefile.common +++ b/Makefile.common @@ -61,7 +61,7 @@ PROMU_URL := https://github.com/prometheus/promu/releases/download/v$(PROMU_ SKIP_GOLANGCI_LINT := GOLANGCI_LINT := GOLANGCI_LINT_OPTS ?= -GOLANGCI_LINT_VERSION ?= v1.49.0 +GOLANGCI_LINT_VERSION ?= v1.50.1 # golangci-lint only supports linux, darwin and windows platforms on i386/amd64. # windows isn't included here because of the path separator being different. ifeq ($(GOHOSTOS),$(filter $(GOHOSTOS),linux darwin)) diff --git a/cluster/advertise.go b/cluster/advertise.go index 8f0f19dd..b1b8fe94 100644 --- a/cluster/advertise.go +++ b/cluster/advertise.go @@ -23,8 +23,10 @@ import ( type getIPFunc func() (string, error) // These are overridden in unit tests to mock the sockaddr functions. -var getPrivateAddress getIPFunc = sockaddr.GetPrivateIP -var getPublicAddress getIPFunc = sockaddr.GetPublicIP +var ( + getPrivateAddress getIPFunc = sockaddr.GetPrivateIP + getPublicAddress getIPFunc = sockaddr.GetPublicIP +) // calculateAdvertiseAddress attempts to clone logic from deep within memberlist // (NetTransport.FinalAdvertiseAddr) in order to surface its conclusions to the