Skip to content

Commit b74a4f7

Browse files
authored
Merge pull request #57 from linuxkit/update-gofmt
fix formatting
2 parents 1b62775 + 3f6fd18 commit b74a4f7

File tree

4 files changed

+22
-70
lines changed

4 files changed

+22
-70
lines changed

.circleci/config.yml

-48
This file was deleted.

.github/workflows/ci.yml

+12-13
Original file line numberDiff line numberDiff line change
@@ -8,27 +8,26 @@ jobs:
88
runs-on: ubuntu-latest
99
steps:
1010

11-
- name: Set up Go 1.15
12-
uses: actions/setup-go@v2
11+
- name: Set up Go 1.19
12+
uses: actions/setup-go@v3
1313
with:
14-
go-version: 1.15
14+
go-version: 1.19.2
1515
id: go
1616

1717
- name: Set path
1818
run: echo "$(go env GOPATH)/bin" >> $GITHUB_PATH
1919
env:
2020
GOPATH: ${{runner.workspace}}
2121

22+
- name: Check out code
23+
uses: actions/checkout@v3
24+
2225
- name: Get pre-requisites
2326
run: |
24-
go get -u golang.org/x/lint/golint
25-
go get -u github.com/gordonklaus/ineffassign
27+
make install-deps
2628
env:
2729
GOPATH: ${{runner.workspace}}
2830

29-
- name: Check out code
30-
uses: actions/checkout@v2
31-
3231
- name: Tests
3332
run: |
3433
make test
@@ -45,14 +44,14 @@ jobs:
4544
runs-on: ubuntu-latest
4645
steps:
4746

48-
- name: Set up Go 1.15
49-
uses: actions/setup-go@v2
47+
- name: Set up Go 1.19
48+
uses: actions/setup-go@v3
5049
with:
51-
go-version: 1.15
50+
go-version: 1.19.2
5251
id: go
5352

5453
- name: Check out code
55-
uses: actions/checkout@v2
54+
uses: actions/checkout@v3
5655

5756
- name: build
5857
id: build
@@ -70,7 +69,7 @@ jobs:
7069
GOPATH: ${{runner.workspace}}
7170

7271
- name: Upload binary
73-
uses: actions/upload-artifact@v2
72+
uses: actions/upload-artifact@v3
7473
with:
7574
name: rtf-binaries
7675
path: ${{steps.build.outputs.binary}}

Makefile

+9-9
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ DEPS+=$(wildcard sysinfo/*.go)
2020

2121
PREFIX?=/usr/local
2222

23-
GOLINT:=$(shell command -v golint 2> /dev/null)
23+
GOLINT:=$(shell command -v golangci-lint 2> /dev/null)
2424
INEFFASSIGN:=$(shell command -v ineffassign 2> /dev/null)
2525

2626
default: rtf
@@ -43,27 +43,27 @@ rtf: $(DEPS)
4343
.PHONY: lint
4444
lint:
4545
ifndef GOLINT
46-
$(error "Please install golint! go get -u github.com/tool/lint")
46+
$(error "Please install golangci-lint! http://golangci-lint.run")
4747
endif
4848
ifndef INEFFASSIGN
49-
$(error "Please install ineffassign! go get -u github.com/gordonklaus/ineffassign")
49+
$(error "Please install ineffassign! go install github.com/gordonklaus/ineffassign@latest")
5050
endif
51-
@echo "+ $@: golint, gofmt, go vet, ineffassign"
52-
# golint
53-
@test -z "$(shell find . -type f -name "*.go" -not -path "./vendor/*" -exec golint {} \; | tee /dev/stderr)"
51+
@echo "+ $@: golangci-lint, gofmt, go vet, ineffassign"
52+
# golangci-lint
53+
@test -z "$$(golangci-lint run ./... | tee /dev/stderr)"
5454
# gofmt
5555
@test -z "$$(gofmt -s -l .| grep -v .pb. | grep -v vendor/ | tee /dev/stderr)"
5656
ifeq ($(GOOS),)
5757
# govet
5858
@test -z "$$(go tool vet -printf=false . 2>&1 | grep -v vendor/ | tee /dev/stderr)"
5959
endif
6060
# ineffassign
61-
@test -z $(find . -type f -name "*.go" -not -path "*/vendor/*" -exec ineffassign {} \; | tee /dev/stderr)
61+
@test -z $$(ineffassign ./... | tee /dev/stderr)
6262

6363
.PHONY: install-deps
6464
install-deps:
65-
go get -u github.com/tool/lint
66-
go get -u github.com/gordonklaus/ineffassign
65+
go install github.com/golangci/golangci-lint/cmd/[email protected]
66+
go install github.com/gordonklaus/ineffassign@latest
6767

6868
.PHONY: test
6969
test: rtf lint

sysinfo/sysinfo_unsupported.go

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
//go:build !linux && !darwin && !windows
12
// +build !linux,!darwin,!windows
23

34
package sysinfo

0 commit comments

Comments
 (0)