Skip to content

Commit c37f32f

Browse files
authored
Merge pull request #3150 from bobbypage/upstream/presubmit
Re-enable presubmit linting
2 parents 9c6fb75 + 225af2b commit c37f32f

File tree

19 files changed

+27
-14
lines changed

19 files changed

+27
-14
lines changed

.golangci.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@ issues:
3939
- "(method|func) [A-Z].* should be .*"
4040
# Stuttering affects exported names:
4141
- "type name will be used as .*\\.[A-Z]{1}.* by other packages, and that stutters"
42+
# TODO: Migrate away from io/ioutil
43+
- "\"io/ioutil\" has been deprecated since Go 1.16"
4244
exclude-rules:
4345
# utils/cpuload/netlink/netlink.go:102:15: Error return value of `binary.Write` is not checked (errcheck)
4446
# There are more similar issues in this file

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
# limitations under the License.
1414

1515
GO := go
16-
GOLANGCI_VER := v1.45.2
16+
GOLANGCI_VER := v1.48.0
1717
GO_TEST ?= $(GO) test $(or $(GO_FLAGS),-race)
1818
arch ?= $(shell go env GOARCH)
1919

@@ -74,7 +74,7 @@ docker-%:
7474
docker-build:
7575
@docker run --rm -w /go/src/github.com/google/cadvisor -v ${PWD}:/go/src/github.com/google/cadvisor golang:1.19 make build
7676

77-
presubmit: # lint : TODO re-enable lint after it works on golang 1.19
77+
presubmit: lint
7878
@echo ">> checking go mod tidy"
7979
@./build/check_gotidy.sh
8080
@echo ">> checking file boilerplate"

accelerators/nvidia.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
14+
1415
package accelerators
1516

1617
import (

accelerators/nvidia_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
14+
1415
package accelerators
1516

1617
import (

client/client.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,9 @@
1414

1515
// This is an implementation of a cAdvisor REST API in Go.
1616
// To use it, create a client (replace the URL with your actual cAdvisor REST endpoint):
17-
// client, err := client.NewClient("http://192.168.59.103:8080/")
17+
//
18+
// client, err := client.NewClient("http://192.168.59.103:8080/")
19+
//
1820
// Then, the client interface exposes go methods corresponding to the REST endpoints.
1921
package client
2022

cmd/cadvisor.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ func createCollectorHTTPClient(collectorCert, collectorKey string) http.Client {
228228
}
229229

230230
tlsConfig.Certificates = []tls.Certificate{cert}
231-
tlsConfig.BuildNameToCertificate()
231+
tlsConfig.BuildNameToCertificate() //nolint: staticcheck
232232
}
233233

234234
transport := &http.Transport{

container/containerd/grpc.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15-
//This code has been taken from containerd repo to avoid large library import
15+
// This code has been taken from containerd repo to avoid large library import
1616
package containerd
1717

1818
import (

container/containerd/namespaces/store.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,6 @@ import "context"
3737
// oriented. A namespace is really just a name and a set of labels. Objects
3838
// that belong to a namespace are returned when the namespace is assigned to a
3939
// given context.
40-
//
41-
//
4240
type Store interface {
4341
Create(ctx context.Context, namespace string, labels map[string]string) error
4442
Labels(ctx context.Context, namespace string) (map[string]string, error)

devicemapper/dmsetup_client.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
14+
1415
package devicemapper
1516

1617
import (

devicemapper/fake/dmsetup_client_fake.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
14+
1415
package fake
1516

1617
import (

0 commit comments

Comments
 (0)