Skip to content
Open
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
11 changes: 7 additions & 4 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
GO_VERSION: [ "1.19","1.20","1.21" ]
GO_VERSION: ["1.24", "1.25"]
steps:
- name: "Fetch source code"
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
Expand Down Expand Up @@ -49,7 +49,10 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
GO_VERSION: [ "1.19","1.20","1.21" ]
GO_VERSION: ["1.24", "1.25"]
env:
# Coordinate Performance Tests rely on Go 1.16 RNG seeding behavior.
GODEBUG: "randseednop=0"
steps:
- name: "Fetch source code"
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
Expand Down Expand Up @@ -90,7 +93,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
GO_VERSION: [ "1.19","1.20","1.21" ]
GO_VERSION: ["1.24", "1.25"]
steps:
- name: "Fetch source code"
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
Expand Down Expand Up @@ -122,7 +125,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
GO_VERSION: [ "1.19","1.20","1.21" ]
GO_VERSION: ["1.24", "1.25"]
steps:
- name: "Fetch source code"
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
Expand Down
112 changes: 58 additions & 54 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
# Copyright (c) HashiCorp, Inc.
# SPDX-License-Identifier: MPL-2.0

version: "2"
linters:
disable-all: true
default: none
enable:
# (TODO) uncomment after fixing the lint issues
# - gofmt
Expand All @@ -13,70 +14,73 @@ linters:
# - unparam
- forbidigo

issues:
# Disable the default exclude list so that all excludes are explicitly
# defined in this file.
exclude-use-default: false
settings:
forbidigo:
# Forbid the following identifiers (list of regexp).
forbid:
- pattern: '\brequire\.New\b(# Use package-level functions with explicit TestingT)?'
- pattern: '\bassert\.New\b(# Use package-level functions with explicit TestingT)?'
- pattern: '\bmetrics\.IncrCounter\b(# Use labeled metrics)?'
- pattern: '\bmetrics\.AddSample\b(# Use labeled metrics)?'
- pattern: '\bmetrics\.MeasureSince\b(# Use labeled metrics)?'
- pattern: '\bmetrics\.SetGauge\b(# Use labeled metrics)?'
# Expattern: clude godoc examples from forbidigo checks.
# Default: true
exclude-godoc-examples: false

exclude-rules:
# Temp Ignore SA9004: only the first constant in this group has an explicit type
# https://staticcheck.io/docs/checks#SA9004
- linters: [staticcheck]
text: 'SA9004:'
exclusions:
rules:
# Temp Ignore SA9004: only the first constant in this group has an explicit type
# https://staticcheck.io/docs/checks#SA9004
- linters: [staticcheck]
text: "SA9004:"

- linters: [staticcheck]
text: 'SA1019: Package github.com/golang/protobuf/jsonpb is deprecated'
- linters: [staticcheck]
text: "SA1019: Package github.com/golang/protobuf/jsonpb is deprecated"

- linters: [staticcheck]
text: 'SA1019: Package github.com/golang/protobuf/proto is deprecated'
- linters: [staticcheck]
text: "SA1019: Package github.com/golang/protobuf/proto is deprecated"

- linters: [staticcheck]
text: 'SA1019: ptypes.MarshalAny is deprecated'
- linters: [staticcheck]
text: "SA1019: ptypes.MarshalAny is deprecated"

- linters: [staticcheck]
text: 'SA1019: ptypes.UnmarshalAny is deprecated'
- linters: [staticcheck]
text: "SA1019: ptypes.UnmarshalAny is deprecated"

- linters: [staticcheck]
text: 'SA1019: package github.com/golang/protobuf/ptypes is deprecated'
- linters: [staticcheck]
text: "SA1019: package github.com/golang/protobuf/ptypes is deprecated"

# An argument that always receives the same value is often not a problem.
- linters: [unparam]
text: 'always receives'
# An argument that always receives the same value is often not a problem.
- linters: [unparam]
text: "always receives"

# Often functions will implement an interface that returns an error without
# needing to return an error. Sometimes the error return value is unnecessary
# but a linter can not tell the difference.
- linters: [unparam]
text: 'result \d+ \(error\) is always nil'
# Often functions will implement an interface that returns an error without
# needing to return an error. Sometimes the error return value is unnecessary
# but a linter can not tell the difference.
- linters: [unparam]
text: 'result \d+ \(error\) is always nil'

# Allow unused parameters to start with an underscore. Arguments with a name
# of '_' are already ignored.
# Ignoring longer names that start with underscore allow for better
# self-documentation than a single underscore by itself. Underscore arguments
# should generally only be used when a function is implementing an interface.
- linters: [unparam]
text: '`_[^`]*` is unused'
# Allow unused parameters to start with an underscore. Arguments with a name
# of '_' are already ignored.
# Ignoring longer names that start with underscore allow for better
# self-documentation than a single underscore by itself. Underscore arguments
# should generally only be used when a function is implementing an interface.
- linters: [unparam]
text: "`_[^`]*` is unused"

# Temp ignore some common unused parameters so that unparam can be added
# incrementally.
- linters: [unparam]
text: '`(t|resp|req|entMeta)` is unused'
# Temp ignore some common unused parameters so that unparam can be added
# incrementally.
- linters: [unparam]
text: "`(t|resp|req|entMeta)` is unused"

linters-settings:
gofmt:
simplify: true
forbidigo:
# Forbid the following identifiers (list of regexp).
forbid:
- '\brequire\.New\b(# Use package-level functions with explicit TestingT)?'
- '\bassert\.New\b(# Use package-level functions with explicit TestingT)?'
- '\bmetrics\.IncrCounter\b(# Use labeled metrics)?'
- '\bmetrics\.AddSample\b(# Use labeled metrics)?'
- '\bmetrics\.MeasureSince\b(# Use labeled metrics)?'
- '\bmetrics\.SetGauge\b(# Use labeled metrics)?'
# Exclude godoc examples from forbidigo checks.
# Default: true
exclude_godoc_examples: false
formatters:
enable:
- gofmt
settings:
gofmt:
# Simplify code: gofmt with `-s` option.
# Default: true
simplify: false

run:
timeout: 10m
Expand Down
21 changes: 12 additions & 9 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
module github.com/hashicorp/serf

go 1.19
go 1.24.0

toolchain go1.24.7

require (
github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e
github.com/hashicorp/go-metrics v0.5.4
github.com/hashicorp/go-msgpack/v2 v2.1.2
github.com/hashicorp/go-msgpack/v2 v2.1.5
github.com/hashicorp/go-syslog v1.0.0
github.com/hashicorp/logutils v1.0.0
github.com/hashicorp/mdns v1.0.5
github.com/hashicorp/memberlist v0.5.2
github.com/hashicorp/mdns v1.0.6
github.com/hashicorp/memberlist v0.5.3
github.com/mitchellh/cli v1.1.5
github.com/mitchellh/mapstructure v1.5.0
github.com/ryanuber/columnize v2.1.2+incompatible
Expand Down Expand Up @@ -42,9 +44,10 @@ require (
github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529 // indirect
github.com/shopspring/decimal v1.2.0 // indirect
github.com/spf13/cast v1.3.1 // indirect
golang.org/x/crypto v0.33.0 // indirect
golang.org/x/mod v0.13.0 // indirect
golang.org/x/net v0.35.0 // indirect
golang.org/x/sys v0.30.0 // indirect
golang.org/x/tools v0.14.0 // indirect
golang.org/x/crypto v0.42.0 // indirect
golang.org/x/mod v0.28.0 // indirect
golang.org/x/net v0.44.0 // indirect
golang.org/x/sync v0.17.0 // indirect
golang.org/x/sys v0.36.0 // indirect
golang.org/x/tools v0.37.0 // indirect
)
Loading
Loading