Skip to content

Commit 37b0675

Browse files
committed
add sshproxy.go tests, remove unused code, upgrade vendors
1 parent 639f4ce commit 37b0675

File tree

146 files changed

+3953
-2805
lines changed

Some content is hidden

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

146 files changed

+3953
-2805
lines changed

Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ test:
101101

102102
benchmark:
103103
mkdir -p benchmarks/results
104-
$(GO) test -failfast -race -count=6 -bench=. -run=^# -benchmem ./... | tee benchmarks/results/$(DATE)-$(COMMIT)
104+
$(GO) test -failfast -race -count=6 -timeout=20m -bench=. -run=^# -benchmem ./... | tee benchmarks/results/$(DATE)-$(COMMIT)
105105

106106
clean:
107107
rm -f $(EXE) $(MANDOC) doc/*.xml sshproxy*.tar.gz test/coverage.*

README.asciidoc

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ be replayed with the +sshproxy-replay+ command.
3232
Compilation
3333
-----------
3434

35-
Install the Go (version >= 1.22) compiler suite: see
35+
Install the Go (version >= 1.23) compiler suite: see
3636
http://golang.org/doc/install for details.
3737

3838
Define and export the +$GOPATH+ directory where the source code will be

cmd/sshproxy/sshproxy.go

+4-1
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ import (
2222
"os/user"
2323
"regexp"
2424
"runtime/debug"
25+
"slices"
2526
"strconv"
2627
"strings"
2728
"sync"
@@ -109,7 +110,7 @@ func findDestination(cli *utils.Client, username string, config *utils.Config, s
109110
log.Errorf("problem with etcd: %v", err)
110111
}
111112
} else {
112-
if utils.IsDestinationInRoutes(dest, config.Dest) {
113+
if slices.Contains(config.Dest, dest) {
113114
if checker.Check(dest) {
114115
log.Debugf("found destination in etcd: %s", dest)
115116
return dest, nil
@@ -167,6 +168,7 @@ func NewSSHInfo(s string) (*SSHInfo, error) {
167168
}
168169
srcport, err := strconv.Atoi(infos[2])
169170
if err != nil {
171+
// will never happen
170172
return nil, errors.New("bad value for source port")
171173
}
172174
dstip := net.ParseIP(infos[3])
@@ -175,6 +177,7 @@ func NewSSHInfo(s string) (*SSHInfo, error) {
175177
}
176178
dstport, err := strconv.Atoi(infos[4])
177179
if err != nil {
180+
// will never happen
178181
return nil, errors.New("bad value for destination port")
179182
}
180183

0 commit comments

Comments
 (0)