Skip to content

Commit a6f0cc8

Browse files
committed
cleanup and upgrade of vendors
1 parent 931c789 commit a6f0cc8

File tree

1,170 files changed

+290855
-237482
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,170 files changed

+290855
-237482
lines changed

.cirrus.yml

Lines changed: 3 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -2,31 +2,9 @@ task:
22
env:
33
GOPROXY: https://proxy.golang.org
44
matrix:
5-
VERSION: 1.15
6-
VERSION: 1.16
7-
8-
container:
9-
image: golang:$VERSION
10-
11-
name: test-$VERSION
12-
13-
test_script:
14-
- apt-get update
15-
- apt-get install -y asciidoc docbook-utils docbook-xml libxml2-utils xsltproc
16-
- GOPATH=/tmp/go
17-
- PATH="$PATH:$GOPATH/bin"
18-
- mkdir -p $GOPATH/src/github.com/cea-hpc
19-
- mv /tmp/cirrus-ci-build $GOPATH/src/github.com/cea-hpc/sshproxy
20-
- cd $GOPATH/src/github.com/cea-hpc/sshproxy
21-
- make
22-
- make get-old-deps check
23-
24-
task:
25-
env:
26-
GOPROXY: https://proxy.golang.org
27-
matrix:
28-
VERSION: 1.17
29-
VERSION: 1.18
5+
VERSION: 1.19
6+
VERSION: 1.20
7+
VERSION: 1.21
308

319
container:
3210
image: golang:$VERSION

Makefile

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -79,11 +79,8 @@ fmt:
7979
$(GO) fmt $(PKGS)
8080
$(GO) fmt $(TEST)
8181

82-
get-old-deps:
83-
$(GO) get -u honnef.co/go/tools/cmd/[email protected]
84-
8582
get-deps:
86-
$(GO) get -u honnef.co/go/tools/cmd/staticcheck
83+
$(GO) install honnef.co/go/tools/cmd/staticcheck@latest
8784

8885
check:
8986
$(GO) vet ./...
@@ -98,4 +95,4 @@ test:
9895
clean:
9996
rm -f $(EXE) $(MANDOC) doc/*.xml sshproxy_*.tar.gz
10097

101-
.PHONY: all exe doc install install-doc-man install-binaries package fmt get-old-deps get-deps check test clean
98+
.PHONY: all exe doc install install-doc-man install-binaries package fmt get-deps check test clean

cmd/sshproxy/commands.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ import (
2020
"strings"
2121
"syscall"
2222

23-
"github.com/docker/docker/pkg/term"
23+
"github.com/moby/term"
2424
"github.com/kr/pty"
2525
)
2626

cmd/sshproxy/sshproxy.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,9 @@ import (
3030

3131
"github.com/cea-hpc/sshproxy/pkg/utils"
3232

33-
"github.com/docker/docker/pkg/term"
33+
"github.com/moby/term"
3434
"github.com/op/go-logging"
35-
"go.etcd.io/etcd/clientv3"
35+
"go.etcd.io/etcd/client/v3"
3636
)
3737

3838
var (

go.mod

Lines changed: 29 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,40 @@
11
module github.com/cea-hpc/sshproxy
22

3-
go 1.15
3+
go 1.21
44

55
require (
6-
github.com/BurntSushi/toml v1.0.0 // indirect
7-
github.com/coreos/etcd v2.3.8+incompatible // indirect
86
github.com/docker/docker v20.10.13+incompatible
9-
github.com/gogo/protobuf v1.3.2 // indirect
10-
github.com/golang/protobuf v1.5.2 // indirect
117
github.com/kr/pty v1.1.8
12-
github.com/moby/term v0.0.0-20210619224110-3f7ff695adc6 // indirect
138
github.com/olekukonko/tablewriter v0.0.5
149
github.com/op/go-logging v0.0.0-20160315200505-970db520ece7
1510
go.etcd.io/etcd v2.3.8+incompatible
16-
golang.org/x/lint v0.0.0-20210508222113-6edffad5e616 // indirect
17-
golang.org/x/sys v0.0.0-20220319134239-a9b59b0215f8 // indirect
18-
golang.org/x/tools v0.1.10 // indirect
11+
go.etcd.io/etcd/client/v3 v3.5.9
1912
gopkg.in/yaml.v2 v2.4.0
20-
honnef.co/go/tools v0.2.2 // indirect
13+
)
14+
15+
require (
16+
github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1 // indirect
17+
github.com/BurntSushi/toml v1.3.2 // indirect
18+
github.com/coreos/go-semver v0.3.0 // indirect
19+
github.com/coreos/go-systemd/v22 v22.3.2 // indirect
20+
github.com/creack/pty v1.1.11 // indirect
21+
github.com/gogo/protobuf v1.3.2 // indirect
22+
github.com/golang/protobuf v1.5.2 // indirect
23+
github.com/mattn/go-runewidth v0.0.9 // indirect
24+
github.com/moby/term v0.0.0-20210619224110-3f7ff695adc6 // indirect
25+
go.etcd.io/etcd/api/v3 v3.5.9 // indirect
26+
go.etcd.io/etcd/client/pkg/v3 v3.5.9 // indirect
27+
go.uber.org/atomic v1.7.0 // indirect
28+
go.uber.org/multierr v1.6.0 // indirect
29+
go.uber.org/zap v1.17.0 // indirect
30+
golang.org/x/exp/typeparams v0.0.0-20231006140011-7918f672742d // indirect
31+
golang.org/x/mod v0.13.0 // indirect
32+
golang.org/x/net v0.16.0 // indirect
33+
golang.org/x/sys v0.13.0 // indirect
34+
golang.org/x/text v0.13.0 // indirect
35+
golang.org/x/tools v0.14.0 // indirect
36+
google.golang.org/genproto v0.0.0-20210602131652-f16073e35f0c // indirect
37+
google.golang.org/grpc v1.41.0 // indirect
38+
google.golang.org/protobuf v1.26.0 // indirect
39+
honnef.co/go/tools v0.4.6 // indirect
2140
)

go.sum

Lines changed: 157 additions & 20 deletions
Large diffs are not rendered by default.

pkg/utils/config.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ package utils
1212

1313
import (
1414
"fmt"
15-
"io/ioutil"
15+
"os"
1616
"regexp"
1717
"strings"
1818
"time"
@@ -207,7 +207,7 @@ func LoadConfig(filename, currentUsername, sid string, start time.Time, groups m
207207
"{time}": {regexp.MustCompile(`{time}`), start.Format(time.RFC3339Nano)},
208208
}
209209

210-
yamlFile, err := ioutil.ReadFile(filename)
210+
yamlFile, err := os.ReadFile(filename)
211211
if err != nil {
212212
return nil, err
213213
}

pkg/utils/etcd.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ import (
2424
"time"
2525

2626
"github.com/op/go-logging"
27-
"go.etcd.io/etcd/clientv3"
27+
"go.etcd.io/etcd/client/v3"
2828
"go.etcd.io/etcd/pkg/transport"
2929
)
3030

pkg/utils/route.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,6 @@ func selectDestinationOrdered(destinations []string, checker HostChecker, cli *C
8787
// destinations and selects the first reachable one. It returns its host and
8888
// port.
8989
func selectDestinationRandom(destinations []string, checker HostChecker, cli *Client, key string) (string, error) {
90-
rand.Seed(time.Now().UnixNano())
9190
rdestinations := make([]string, len(destinations))
9291
perm := rand.Perm(len(destinations))
9392
for i, v := range perm {
@@ -126,7 +125,6 @@ func selectDestinationConnections(destinations []string, checker HostChecker, cl
126125
case hostsc[destinations[i]] != hostsc[destinations[j]]:
127126
return hostsc[destinations[i]] < hostsc[destinations[j]]
128127
default:
129-
rand.Seed(time.Now().UnixNano())
130128
return rand.Intn(2) != 0
131129
}
132130
})
@@ -165,7 +163,6 @@ func selectDestinationBandwidth(destinations []string, checker HostChecker, cli
165163
case hostsbw[destinations[i]] != hostsbw[destinations[j]]:
166164
return hostsbw[destinations[i]] < hostsbw[destinations[j]]
167165
default:
168-
rand.Seed(time.Now().UnixNano())
169166
return rand.Intn(2) != 0
170167
}
171168
})

test/centos-image/sshproxy_test.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ import (
99
"encoding/json"
1010
"fmt"
1111
"io"
12-
"io/ioutil"
1312
"log"
1413
"net"
1514
"os"
@@ -94,10 +93,10 @@ func runCommand(ctx context.Context, name string, args []string, env []string, p
9493
processChan <- cmd.Process
9594
}
9695

97-
stdout, _ := ioutil.ReadAll(stdoutPipe)
96+
stdout, _ := io.ReadAll(stdoutPipe)
9897
stderr := []byte{}
9998
if ctx.Err() != context.DeadlineExceeded {
100-
stderr, _ = ioutil.ReadAll(stderrPipe)
99+
stderr, _ = io.ReadAll(stderrPipe)
101100
}
102101

103102
err = cmd.Wait()

0 commit comments

Comments
 (0)