Skip to content

Commit db271c4

Browse files
committed
refactor: update NewFromReader to accept multiple io.Reader parameters
1 parent 4b4a353 commit db271c4

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

ssh/knownhosts/reader.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ import (
1212
// operates on the hostname if available, i.e. if a server changes its
1313
// IP address, the host key check will still succeed, even though a
1414
// record of the new IP address is not available.
15-
func NewFromReader(r io.Reader) (ssh.HostKeyCallback, error) {
15+
func NewFromReader(readers ...io.Reader) (ssh.HostKeyCallback, error) {
1616
db := newHostKeyDB()
17-
if err := db.Read(r, ""); err != nil {
17+
if err := db.Read(io.MultiReader(readers...), ""); err != nil {
1818
return nil, err
1919
}
2020

0 commit comments

Comments
 (0)