8000 remove unnecessary type · etherscan-io/sftp@d0a1c80 · GitHub
[go: up one dir, main page]

Skip to content

Commit d0a1c80

Browse files
committed
remove unnecessary type
Added to shorten code text, but not used enough to be worth the extra type.
1 parent 57673e3 commit d0a1c80

File tree

4 files changed

+4
-5
lines changed

4 files changed

+4
-5
lines changed

packet-manager.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,8 @@ func (s *packetManager) close() {
7878
// The goal is to process packets in the order they are received as is
7979
// requires by section 7 of the RFC, while maximizing throughput of file
8080
// transfers.
81-
func (s *packetManager) workerChan(runWorker func(requestChan)) requestChan {
81+
func (s *packetManager) workerChan(runWorker func(chan requestPacket),
82+
) chan requestPacket {
8283

8384
rwChan := make(chan requestPacket, SftpServerWorkerCount)
8485
for i := 0; i < SftpServerWorkerCount; i++ {

packet-typing.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@ type requestPacket interface {
1212
id() uint32
1313
}
1414

15-
type requestChan chan requestPacket
16-
1715
type responsePacket interface {
1816
encoding.BinaryMarshaler
1917
id() uint32

request-server.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ func (rs *RequestServer) Serve() error {
106106
ctx, cancel := context.WithCancel(context.Background())
107107
defer cancel()
108108
var wg sync.WaitGroup
109-
runWorker := func(ch requestChan) {
109+
runWorker := func(ch chan requestPacket) {
110110
wg.Add(1)
111111
go func() {
112112
defer wg.Done()

server.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,7 @@ func handlePacket(s *Server, p interface{}) error {
287287
// is stopped.
288288
func (svr *Server) Serve() error {
289289
var wg sync.WaitGroup
290-
runWorker := func(ch requestChan) {
290+
runWorker := func(ch chan requestPacket) {
291291
wg.Add(1)
292292
go func() {
293293
defer wg.Done()

0 commit comments

Comments
 (0)
0