From 343f7242f3471e6edb27a9aa9537534eb0cda60c Mon Sep 17 00:00:00 2001 From: Ivan Valdes Date: Sun, 19 Oct 2025 21:36:39 -0700 Subject: [PATCH] Enable goheader golangi-lint linter Update source code files that were missing or had incorrect license headers. For those that had the incorrect license, set the date to 2025. Signed-off-by: Ivan Valdes --- client/pkg/logutil/zap_test.go | 2 +- client/pkg/pathutil/path.go | 16 +++++++++++++--- client/pkg/testutil/leak.go | 16 +++++++++++++--- pkg/crc/crc.go | 16 +++++++++++++--- pkg/crc/crc_test.go | 16 +++++++++++++--- server/auth/main_test.go | 16 +++++++++++++--- server/etcdmain/help.go | 1 - server/proxy/grpcproxy/election.go | 2 +- server/proxy/grpcproxy/lock.go | 2 +- tests/e2e/defrag_no_space_test.go | 2 +- tests/e2e/main_test.go | 16 +++++++++++++--- .../clientv3/connectivity/main_test.go | 16 +++++++++++++--- tests/integration/clientv3/lease/main_test.go | 16 +++++++++++++--- tests/integration/clientv3/main_test.go | 16 +++++++++++++--- .../integration/clientv3/naming/main_test.go | 16 +++++++++++++--- tests/integration/main_test.go | 16 +++++++++++++--- tests/robustness/client/kvhash.go | 2 +- tests/robustness/model/history_test.go | 2 +- tools/.golangci.yaml | 19 +++++++++++++++++++ tools/etcd-dump-logs/raw_test.go | 3 ++- 20 files changed, 170 insertions(+), 41 deletions(-) diff --git a/client/pkg/logutil/zap_test.go b/client/pkg/logutil/zap_test.go index ac12e1aee..4ccee8bb7 100644 --- a/client/pkg/logutil/zap_test.go +++ b/client/pkg/logutil/zap_test.go @@ -4,7 +4,7 @@ // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // -// http://www.apache.org/licenses/LICENSE-2.0 +// http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, diff --git a/client/pkg/pathutil/path.go b/client/pkg/pathutil/path.go index f26254ba9..6e968922b 100644 --- a/client/pkg/pathutil/path.go +++ b/client/pkg/pathutil/path.go @@ -1,6 +1,16 @@ -// Copyright 2009 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. +// Copyright 2025 The etcd Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. // Package pathutil implements utility functions for handling slash-separated // paths. diff --git a/client/pkg/testutil/leak.go b/client/pkg/testutil/leak.go index 31db0e5fd..61e7554ed 100644 --- a/client/pkg/testutil/leak.go +++ b/client/pkg/testutil/leak.go @@ -1,6 +1,16 @@ -// Copyright 2013 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. +// Copyright 2025 The etcd Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. package testutil diff --git a/pkg/crc/crc.go b/pkg/crc/crc.go index 4b998a484..dc4a19d86 100644 --- a/pkg/crc/crc.go +++ b/pkg/crc/crc.go @@ -1,6 +1,16 @@ -// Copyright 2009 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. +// Copyright 2025 The etcd Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. // Package crc provides utility function for cyclic redundancy check // algorithms. diff --git a/pkg/crc/crc_test.go b/pkg/crc/crc_test.go index 38990fac6..732b343ee 100644 --- a/pkg/crc/crc_test.go +++ b/pkg/crc/crc_test.go @@ -1,6 +1,16 @@ -// Copyright 2009 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. +// Copyright 2025 The etcd Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. package crc diff --git a/server/auth/main_test.go b/server/auth/main_test.go index 30ff6fb9a..79a9d83b7 100644 --- a/server/auth/main_test.go +++ b/server/auth/main_test.go @@ -1,6 +1,16 @@ -// Copyright 2013 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. +// Copyright 2025 The etcd Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. package auth diff --git a/server/etcdmain/help.go b/server/etcdmain/help.go index 88934b7a4..28f0cb051 100644 --- a/server/etcdmain/help.go +++ b/server/etcdmain/help.go @@ -1,5 +1,4 @@ // Copyright 2015 The etcd Authors -// Copyright 2015 The etcd Authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/server/proxy/grpcproxy/election.go b/server/proxy/grpcproxy/election.go index 9ea8d9615..a52abef68 100644 --- a/server/proxy/grpcproxy/election.go +++ b/server/proxy/grpcproxy/election.go @@ -1,4 +1,4 @@ -// Copyright 2017 The etcd Lockors +// Copyright 2017 The etcd Authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/server/proxy/grpcproxy/lock.go b/server/proxy/grpcproxy/lock.go index 9458080db..a7c1af5c7 100644 --- a/server/proxy/grpcproxy/lock.go +++ b/server/proxy/grpcproxy/lock.go @@ -1,4 +1,4 @@ -// Copyright 2017 The etcd Lockors +// Copyright 2017 The etcd Authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/tests/e2e/defrag_no_space_test.go b/tests/e2e/defrag_no_space_test.go index f3c70c744..feccb2ba4 100644 --- a/tests/e2e/defrag_no_space_test.go +++ b/tests/e2e/defrag_no_space_test.go @@ -4,7 +4,7 @@ // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // -// http://www.apache.org/licenses/LICENSE-2.0 +// http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, diff --git a/tests/e2e/main_test.go b/tests/e2e/main_test.go index 58d7efb95..7ad5f207e 100644 --- a/tests/e2e/main_test.go +++ b/tests/e2e/main_test.go @@ -1,6 +1,16 @@ -// Copyright 2013 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. +// Copyright 2025 The etcd Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. package e2e diff --git a/tests/integration/clientv3/connectivity/main_test.go b/tests/integration/clientv3/connectivity/main_test.go index 39a188823..fb46e5a05 100644 --- a/tests/integration/clientv3/connectivity/main_test.go +++ b/tests/integration/clientv3/connectivity/main_test.go @@ -1,6 +1,16 @@ -// Copyright 2013 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. +// Copyright 2025 The etcd Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. package connectivity diff --git a/tests/integration/clientv3/lease/main_test.go b/tests/integration/clientv3/lease/main_test.go index 1057c4ab8..0064ea6ad 100644 --- a/tests/integration/clientv3/lease/main_test.go +++ b/tests/integration/clientv3/lease/main_test.go @@ -1,6 +1,16 @@ -// Copyright 2013 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. +// Copyright 2025 The etcd Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. package lease_test diff --git a/tests/integration/clientv3/main_test.go b/tests/integration/clientv3/main_test.go index 9481beebc..e17558961 100644 --- a/tests/integration/clientv3/main_test.go +++ b/tests/integration/clientv3/main_test.go @@ -1,6 +1,16 @@ -// Copyright 2013 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. +// Copyright 2025 The etcd Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. package clientv3test diff --git a/tests/integration/clientv3/naming/main_test.go b/tests/integration/clientv3/naming/main_test.go index 92a58a54c..bbebf1c91 100644 --- a/tests/integration/clientv3/naming/main_test.go +++ b/tests/integration/clientv3/naming/main_test.go @@ -1,6 +1,16 @@ -// Copyright 2013 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. +// Copyright 2025 The etcd Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. package naming_test diff --git a/tests/integration/main_test.go b/tests/integration/main_test.go index e78320583..748da914d 100644 --- a/tests/integration/main_test.go +++ b/tests/integration/main_test.go @@ -1,6 +1,16 @@ -// Copyright 2013 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. +// Copyright 2022 The etcd Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. package integration diff --git a/tests/robustness/client/kvhash.go b/tests/robustness/client/kvhash.go index e4fc2b482..5d982e04e 100644 --- a/tests/robustness/client/kvhash.go +++ b/tests/robustness/client/kvhash.go @@ -4,7 +4,7 @@ // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // -// http://www.apache.org/licenses/LICENSE-2.0 +// http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, diff --git a/tests/robustness/model/history_test.go b/tests/robustness/model/history_test.go index 9b6d22f31..263441dca 100644 --- a/tests/robustness/model/history_test.go +++ b/tests/robustness/model/history_test.go @@ -4,7 +4,7 @@ // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // -// http://www.apache.org/licenses/LICENSE-2.0 +// http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, diff --git a/tools/.golangci.yaml b/tools/.golangci.yaml index 0651f4ac5..536b539e9 100644 --- a/tools/.golangci.yaml +++ b/tools/.golangci.yaml @@ -4,6 +4,7 @@ linters: default: none enable: # please keep this alphabetized - errorlint + - goheader - govet - ineffassign - misspell @@ -19,6 +20,24 @@ linters: - usetesting - whitespace settings: + goheader: + values: + regexp: + ORIGINAL_YEAR: 20[1-2][0-9] + template: |- + Copyright {{ORIGINAL_YEAR}} The etcd Authors + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. govet: enable: - shadow diff --git a/tools/etcd-dump-logs/raw_test.go b/tools/etcd-dump-logs/raw_test.go index 3deb4bc39..c30537769 100644 --- a/tools/etcd-dump-logs/raw_test.go +++ b/tools/etcd-dump-logs/raw_test.go @@ -4,13 +4,14 @@ // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // -// http://www.apache.org/licenses/LICENSE-2.0 +// http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. + package main import (