mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
Merge pull request #16249 from iuriatan/update-linter
Update linter and protoc
This commit is contained in:
commit
11d22abe2b
4
.github/workflows/static-analysis.yaml
vendored
4
.github/workflows/static-analysis.yaml
vendored
@ -15,12 +15,12 @@ jobs:
|
||||
- name: golangci-lint
|
||||
uses: golangci/golangci-lint-action@639cd343e1d3b897ff35927a75193d57cfcba299 # v3.6.0
|
||||
with:
|
||||
version: v1.49.0
|
||||
version: v1.53.3
|
||||
args: --config tools/.golangci.yaml
|
||||
- name: protoc
|
||||
uses: arduino/setup-protoc@149f6c87b92550901b26acd1632e11c3662e381f # v1.3.0
|
||||
with:
|
||||
version: '3.14.0'
|
||||
version: '3.20.3'
|
||||
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
- run: |
|
||||
set -euo pipefail
|
||||
|
@ -515,7 +515,7 @@ func (rc *raftNode) serveRaft() {
|
||||
func (rc *raftNode) Process(ctx context.Context, m raftpb.Message) error {
|
||||
return rc.node.Step(ctx, m)
|
||||
}
|
||||
func (rc *raftNode) IsIDRemoved(id uint64) bool { return false }
|
||||
func (rc *raftNode) IsIDRemoved(_ uint64) bool { return false }
|
||||
func (rc *raftNode) ReportUnreachable(id uint64) { rc.node.ReportUnreachable(id) }
|
||||
func (rc *raftNode) ReportSnapshot(id uint64, status raft.SnapshotStatus) {
|
||||
rc.node.ReportSnapshot(id, status)
|
||||
|
@ -78,7 +78,7 @@ func newCluster(n int) *cluster {
|
||||
func (clus *cluster) Close() (err error) {
|
||||
for i := range clus.peers {
|
||||
go func(i int) {
|
||||
for range clus.commitC[i] {
|
||||
for range clus.commitC[i] { //revive:disable-line:empty-block
|
||||
// drain pending commits
|
||||
}
|
||||
}(i)
|
||||
@ -125,7 +125,7 @@ func TestProposeOnCommit(t *testing.T) {
|
||||
}
|
||||
}
|
||||
donec <- struct{}{}
|
||||
for range cC {
|
||||
for range cC { //revive:disable-line:empty-block
|
||||
// acknowledge the commits from other nodes so
|
||||
// raft continues to make progress
|
||||
}
|
||||
|
@ -14,8 +14,8 @@ fi
|
||||
|
||||
source ./scripts/test_lib.sh
|
||||
|
||||
if [[ $(protoc --version | cut -f2 -d' ') != "3.14.0" ]]; then
|
||||
echo "could not find protoc 3.14.0, is it installed + in PATH?"
|
||||
if [[ $(protoc --version | cut -f2 -d' ') != "3.20.3" ]]; then
|
||||
echo "could not find protoc 3.20.3, is it installed + in PATH?"
|
||||
exit 255
|
||||
fi
|
||||
|
||||
|
@ -110,7 +110,7 @@ type Transport struct {
|
||||
Raft Raft // raft state machine, to which the Transport forwards received messages and reports status
|
||||
Snapshotter *snap.Snapshotter
|
||||
ServerStats *stats.ServerStats // used to record general transportation statistics
|
||||
// used to record transportation statistics with followers when
|
||||
// LeaderStats records transportation statistics with followers when
|
||||
// performing as leader in raft protocol
|
||||
LeaderStats *stats.LeaderStats
|
||||
// ErrorC is used to report detected critical errors, e.g.,
|
||||
|
@ -42,7 +42,7 @@ func init() {
|
||||
leaseKeepaliveCmd.Flags().IntVar(&leaseKeepaliveTotal, "total", 10000, "Total number of lease keepalive requests")
|
||||
}
|
||||
|
||||
func leaseKeepaliveFunc(cmd *cobra.Command, args []string) {
|
||||
func leaseKeepaliveFunc(_ *cobra.Command, _ []string) {
|
||||
requests := make(chan struct{})
|
||||
clients := mustCreateClients(totalClients, totalConns)
|
||||
|
||||
|
@ -70,7 +70,7 @@ func createBytesSlice(bytesN, sliceN int) [][]byte {
|
||||
return rs
|
||||
}
|
||||
|
||||
func mvccPutFunc(cmd *cobra.Command, args []string) {
|
||||
func mvccPutFunc(_ *cobra.Command, _ []string) {
|
||||
if cpuProfPath != "" {
|
||||
f, err := os.Create(cpuProfPath)
|
||||
if err != nil {
|
||||
|
@ -59,6 +59,6 @@ func init() {
|
||||
mvccCmd.PersistentFlags().IntVar(&batchLimit, "batch-limit", 10000, "A limit of batched transaction")
|
||||
}
|
||||
|
||||
func mvccPreRun(cmd *cobra.Command, args []string) {
|
||||
func mvccPreRun(_ *cobra.Command, _ []string) {
|
||||
initMVCC()
|
||||
}
|
||||
|
@ -71,7 +71,7 @@ func init() {
|
||||
putCmd.Flags().BoolVar(&checkHashkv, "check-hashkv", false, "'true' to check hashkv")
|
||||
}
|
||||
|
||||
func putFunc(cmd *cobra.Command, args []string) {
|
||||
func putFunc(cmd *cobra.Command, _ []string) {
|
||||
if keySpaceSize <= 0 {
|
||||
fmt.Fprintf(os.Stderr, "expected positive --key-space-size, got (%v)", keySpaceSize)
|
||||
os.Exit(1)
|
||||
|
@ -69,7 +69,7 @@ func init() {
|
||||
stmCmd.Flags().IntVar(&stmRate, "rate", 0, "Maximum STM transactions per second (0 is no limit)")
|
||||
}
|
||||
|
||||
func stmFunc(cmd *cobra.Command, args []string) {
|
||||
func stmFunc(cmd *cobra.Command, _ []string) {
|
||||
if stmKeyCount <= 0 {
|
||||
fmt.Fprintf(os.Stderr, "expected positive --keys, got (%v)", stmKeyCount)
|
||||
os.Exit(1)
|
||||
|
@ -69,7 +69,7 @@ type request struct {
|
||||
op v3.Op
|
||||
}
|
||||
|
||||
func mixedTxnFunc(cmd *cobra.Command, args []string) {
|
||||
func mixedTxnFunc(cmd *cobra.Command, _ []string) {
|
||||
if keySpaceSize <= 0 {
|
||||
fmt.Fprintf(os.Stderr, "expected positive --key-space-size, got (%v)", keySpaceSize)
|
||||
os.Exit(1)
|
||||
|
@ -55,7 +55,7 @@ func init() {
|
||||
txnPutCmd.Flags().IntVar(&keySpaceSize, "key-space-size", 1, "Maximum possible keys")
|
||||
}
|
||||
|
||||
func txnPutFunc(cmd *cobra.Command, args []string) {
|
||||
func txnPutFunc(_ *cobra.Command, _ []string) {
|
||||
if keySpaceSize <= 0 {
|
||||
fmt.Fprintf(os.Stderr, "expected positive --key-space-size, got (%v)", keySpaceSize)
|
||||
os.Exit(1)
|
||||
|
@ -88,7 +88,7 @@ func init() {
|
||||
watchCmd.Flags().BoolVar(&watchSeqKeys, "sequential-keys", false, "Use sequential keys")
|
||||
}
|
||||
|
||||
func watchFunc(cmd *cobra.Command, args []string) {
|
||||
func watchFunc(_ *cobra.Command, _ []string) {
|
||||
if watchKeySpaceSize <= 0 {
|
||||
fmt.Fprintf(os.Stderr, "expected positive --key-space-size, got (%v)", watchKeySpaceSize)
|
||||
os.Exit(1)
|
||||
|
@ -49,7 +49,7 @@ func init() {
|
||||
watchGetCmd.Flags().IntVar(&watchEvents, "events", 8, "Number of events per watcher")
|
||||
}
|
||||
|
||||
func watchGetFunc(cmd *cobra.Command, args []string) {
|
||||
func watchGetFunc(_ *cobra.Command, _ []string) {
|
||||
clients := mustCreateClients(totalClients, totalConns)
|
||||
getClient := mustCreateClients(1, 1)
|
||||
|
||||
|
@ -54,7 +54,7 @@ func init() {
|
||||
watchLatencyCmd.Flags().IntVar(&watchLValueSize, "val-size", 32, "Value size of watch response")
|
||||
}
|
||||
|
||||
func watchLatencyFunc(cmd *cobra.Command, args []string) {
|
||||
func watchLatencyFunc(_ *cobra.Command, _ []string) {
|
||||
key := string(mustRandBytes(watchLKeySize))
|
||||
value := string(mustRandBytes(watchLValueSize))
|
||||
|
||||
|
@ -113,7 +113,7 @@ func authDecoder(k, v []byte) {
|
||||
}
|
||||
}
|
||||
|
||||
func authRolesDecoder(k, v []byte) {
|
||||
func authRolesDecoder(_, v []byte) {
|
||||
role := &authpb.Role{}
|
||||
err := role.Unmarshal(v)
|
||||
if err != nil {
|
||||
@ -122,7 +122,7 @@ func authRolesDecoder(k, v []byte) {
|
||||
fmt.Printf("role=%q, keyPermission=%v\n", string(role.Name), role.KeyPermission)
|
||||
}
|
||||
|
||||
func authUsersDecoder(k, v []byte) {
|
||||
func authUsersDecoder(_, v []byte) {
|
||||
user := &authpb.User{}
|
||||
err := user.Unmarshal(v)
|
||||
if err != nil {
|
||||
|
@ -68,7 +68,7 @@ func main() {
|
||||
}
|
||||
}
|
||||
|
||||
func listBucketCommandFunc(cmd *cobra.Command, args []string) {
|
||||
func listBucketCommandFunc(_ *cobra.Command, args []string) {
|
||||
if len(args) < 1 {
|
||||
log.Fatalf("Must provide at least 1 argument (got %v)", args)
|
||||
}
|
||||
@ -89,7 +89,7 @@ func listBucketCommandFunc(cmd *cobra.Command, args []string) {
|
||||
}
|
||||
}
|
||||
|
||||
func iterateBucketCommandFunc(cmd *cobra.Command, args []string) {
|
||||
func iterateBucketCommandFunc(_ *cobra.Command, args []string) {
|
||||
if len(args) != 2 {
|
||||
log.Fatalf("Must provide 2 arguments (got %v)", args)
|
||||
}
|
||||
@ -107,7 +107,7 @@ func iterateBucketCommandFunc(cmd *cobra.Command, args []string) {
|
||||
}
|
||||
}
|
||||
|
||||
func getHashCommandFunc(cmd *cobra.Command, args []string) {
|
||||
func getHashCommandFunc(_ *cobra.Command, args []string) {
|
||||
if len(args) < 1 {
|
||||
log.Fatalf("Must provide at least 1 argument (got %v)", args)
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user