Skip to content

Commit 8813368

Browse files
authored
Merge branch 'main' into wifi
2 parents 78fe104 + 6064e51 commit 8813368

13 files changed

Lines changed: 111 additions & 809 deletions

File tree

.github/workflows/go.yml

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -11,42 +11,47 @@ jobs:
1111
build:
1212
runs-on: ubuntu-latest
1313
steps:
14-
- uses: actions/checkout@v2
14+
- uses: actions/checkout@v3
1515

1616
- name: Set up Go
17-
uses: actions/setup-go@v2
17+
uses: actions/setup-go@v3
1818
with:
19-
go-version: 1.15
19+
go-version: '>=1.20.0'
2020

21-
# - name: Lint
22-
# uses: Jerome1337/golint-action@v1.0.2
23-
# with:
24-
# golint-path: './...'
21+
- name: golangci-lint
22+
run: |
23+
go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.51.2
24+
golangci-lint run --skip-files='.*_test.go'
2525
2626
- name: Build
27-
run: make linux-utils
27+
run: make
2828

2929
- name: Test
3030
run: go test -v -covermode=count -coverprofile=coverage.out ./...
3131

3232
- name: Convert coverage to lcov
33-
uses: jandelgado/gcov2lcov-action@v1.0.8
33+
uses: jandelgado/gcov2lcov-action@v1.0.9
3434

3535
- name: Coveralls
36-
uses: coverallsapp/github-action@v1.1.2
36+
uses: coverallsapp/github-action@1.1.3
3737
with:
3838
github-token: ${{ secrets.github_token }}
3939
path-to-lcov: coverage.lcov
4040

41-
4241
sonarcloud:
4342
runs-on: ubuntu-latest
43+
if: ${{ github.triggering_actor != 'dependabot[bot]' }}
4444
steps:
45-
- uses: actions/checkout@v2
45+
- uses: actions/checkout@v3
4646
with:
4747
# Disabling shallow clone is recommended for improving relevancy of reporting
4848
fetch-depth: 0
4949

50+
- name: Set up Go
51+
uses: actions/setup-go@v3
52+
with:
53+
go-version: '>=1.20.0'
54+
5055
- name: Test
5156
run: go test -covermode=count -coverprofile=coverage.out ./...
5257

Makefile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ CONFIGS := $(CONFDIR)/eth0.toml.sample
1212

1313
INSTALLERS := $(PREFIX)/Makefile
1414

15-
BUILT_ON := $(shell date --rfc-3339=seconds | sed 's/ /T/')
16-
BUILT_BY := $(shell whoami)
17-
BUILD_REF := $(shell git symbolic-ref -q --short HEAD || git describe --tags --exact-match)
15+
BUILT_ON ?= $(shell date --rfc-3339=seconds | sed 's/ /T/')
16+
BUILT_BY ?= $(shell whoami)
17+
BUILD_REF ?= $(shell git symbolic-ref -q --short HEAD || git describe --tags --exact-match)
1818

1919
.PHONY: default package
2020

bin/cmd/netctl_up_test.go

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,16 @@
1+
//go:build linux
12
// +build linux
23

34
package cmd
45

56
import (
67
"bytes"
7-
"io/ioutil"
8+
"os"
89
"testing"
910
)
1011

1112
func TestNetctl_Up(t *testing.T) {
12-
dir, err := ioutil.TempDir("", "")
13-
if err != nil {
14-
t.Fatalf("unexpected error: %#v", err)
15-
}
13+
dir, _ := os.MkdirTemp("", "")
1614

1715
for _, test := range []struct {
1816
name string

bin/cmd/root.go

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,16 @@ All rights reserved.
55
Redistribution and use in source and binary forms, with or without
66
modification, are permitted provided that the following conditions are met:
77
8-
1. Redistributions of source code must retain the above copyright notice,
9-
this list of conditions and the following disclaimer.
8+
1. Redistributions of source code must retain the above copyright notice,
9+
this list of conditions and the following disclaimer.
1010
11-
2. Redistributions in binary form must reproduce the above copyright notice,
12-
this list of conditions and the following disclaimer in the documentation
13-
and/or other materials provided with the distribution.
11+
2. Redistributions in binary form must reproduce the above copyright notice,
12+
this list of conditions and the following disclaimer in the documentation
13+
and/or other materials provided with the distribution.
1414
15-
3. Neither the name of the copyright holder nor the names of its contributors
16-
may be used to endorse or promote products derived from this software
17-
without specific prior written permission.
15+
3. Neither the name of the copyright holder nor the names of its contributors
16+
may be used to endorse or promote products derived from this software
17+
without specific prior written permission.
1818
1919
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
2020
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
@@ -38,11 +38,6 @@ import (
3838
"github.com/vinyl-linux/linux-utils/netctl"
3939
)
4040

41-
var (
42-
dollar0 string
43-
useString string
44-
)
45-
4641
// Command Line args
4742
var (
4843
basedir string

bin/cmd/useradd_test.go

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ package cmd
33
import (
44
"bytes"
55
"io"
6-
"io/ioutil"
76
"os"
87
"testing"
98

@@ -14,7 +13,7 @@ import (
1413
func tmpFileAndCopy(in string) (fn string, err error) {
1514
// copy test.pwdFile to some tmpfile
1615
// re-open pwd pointing to it
17-
tmp, err := ioutil.TempFile("", "")
16+
tmp, err := os.CreateTemp("", "")
1817
if err != nil {
1918
return
2019
}
@@ -35,8 +34,6 @@ func tmpFileAndCopy(in string) (fn string, err error) {
3534
}
3635

3736
func TestUseradd(t *testing.T) {
38-
dollar0 = "useradd"
39-
4037
for _, test := range []struct {
4138
name string
4239
args []string
@@ -87,7 +84,7 @@ func TestUseradd(t *testing.T) {
8784
rootCmd.SetOut(b)
8885

8986
reset()
90-
basedir, _ = ioutil.TempDir("", "")
87+
basedir, _ = os.MkdirTemp("", "")
9188

9289
err = rootCmd.Execute()
9390
if err == nil && test.expectError {

bin/cmd/version_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ package cmd
22

33
func ExampleVersion() {
44
rootCmd.SetArgs([]string{"version"})
5-
rootCmd.Execute()
5+
_ = rootCmd.Execute()
66
// output:
77
// linux-utils version
88
// ---

go.mod

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,29 @@
11
module github.com/vinyl-linux/linux-utils
22

3-
go 1.17
3+
go 1.20
44

55
require (
6-
github.com/insomniacslk/dhcp v0.0.0-20210120172423-cc9239ac6294
7-
github.com/otiai10/copy v1.4.2
8-
github.com/pelletier/go-toml v1.9.4
9-
github.com/spf13/cobra v1.3.0
6+
github.com/insomniacslk/dhcp v0.0.0-20230220063916-5369909a5de7
7+
github.com/otiai10/copy v1.9.0
8+
github.com/pelletier/go-toml v1.9.5
9+
github.com/spf13/cobra v1.6.1
1010
github.com/vishvananda/netlink v1.1.0
1111
golang.org/x/crypto v0.0.0-20210817164053-32db794688a5
1212
pifke.org/wpasupplicant v0.0.0-20200816231324-12bdf536389f
1313
)
1414

1515
require (
16-
github.com/inconshreveable/mousetrap v1.0.0 // indirect
17-
github.com/mdlayher/ethernet v0.0.0-20190606142754-0394541c37b7 // indirect
18-
github.com/mdlayher/raw v0.0.0-20191009151244-50f2db8cc065 // indirect
16+
github.com/inconshreveable/mousetrap v1.1.0 // indirect
17+
github.com/josharian/native v1.1.0 // indirect
18+
github.com/mdlayher/ethernet v0.0.0-20220221185849-529eae5b6118 // indirect
19+
github.com/mdlayher/packet v1.1.1 // indirect
20+
github.com/mdlayher/raw v0.1.0 // indirect
21+
github.com/mdlayher/socket v0.4.0 // indirect
22+
github.com/pierrec/lz4/v4 v4.1.17 // indirect
1923
github.com/spf13/pflag v1.0.5 // indirect
20-
github.com/u-root/u-root v7.0.0+incompatible // indirect
21-
github.com/vishvananda/netns v0.0.0-20191106174202-0a2b9b5464df // indirect
22-
golang.org/x/net v0.0.0-20210813160813-60bc85c4be6d // indirect
23-
golang.org/x/sys v0.0.0-20211205182925-97ca703d548d // indirect
24-
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1 // indirect
24+
github.com/u-root/uio v0.0.0-20230220225925-ffce2a382923 // indirect
25+
github.com/vishvananda/netns v0.0.4 // indirect
26+
golang.org/x/net v0.7.0 // indirect
27+
golang.org/x/sync v0.1.0 // indirect
28+
golang.org/x/sys v0.5.0 // indirect
2529
)

0 commit comments

Comments
 (0)