Compare commits

..

1 Commits

Author SHA1 Message Date
dependabot[bot]
ee8590100a
Bump jandelgado/gcov2lcov-action from 1.0.9 to 1.1.1
Bumps [jandelgado/gcov2lcov-action](https://github.com/jandelgado/gcov2lcov-action) from 1.0.9 to 1.1.1.
- [Release notes](https://github.com/jandelgado/gcov2lcov-action/releases)
- [Changelog](https://github.com/jandelgado/gcov2lcov-action/blob/master/CHANGELOG.md)
- [Commits](c680c0f7c7...4e19897678)

---
updated-dependencies:
- dependency-name: jandelgado/gcov2lcov-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-10-15 15:08:58 +00:00
4 changed files with 16 additions and 40 deletions

View File

@ -21,7 +21,7 @@ jobs:
- name: Run tests
run: go test -v -covermode=count -coverprofile=coverage.out
- name: Convert coverage to lcov
uses: jandelgado/gcov2lcov-action@c680c0f7c7442485f1749eb2a13e54a686e76eb5
uses: jandelgado/gcov2lcov-action@4e1989767862652e6ca8d3e2e61aabe6d43be28b
- name: Coveralls
uses: coverallsapp/github-action@643bc377ffa44ace6394b2b5d0d3950076de9f63
with:

35
ftp.go
View File

@ -11,7 +11,6 @@ import (
"io"
"net"
"net/textproto"
"regexp"
"strconv"
"strings"
"time"
@ -828,7 +827,7 @@ func (c *ServerConn) CurrentDir() (string, error) {
end := strings.LastIndex(msg, "\"")
if start == -1 || end == -1 {
return "", errors.New("unsupported PWD response format")
return "", errors.New("unsuported PWD response format")
}
return msg[start+1 : end], nil
@ -1094,38 +1093,6 @@ func (c *ServerConn) Walk(root string) *Walker {
return w
}
// Search returns all the directories matching the search pattern
func (c *ServerConn) Search(pattern string) ([]string, error) {
_, message, err := c.cmd(StatusCommandOK, "SITE SEARCH %s", pattern)
if err != nil {
return nil, err
}
msgs := make([]string, 0)
re := regexp.MustCompile(`^[^\/]*(?P<Path>\/.*) \(.*\).*$`)
for _, msg := range strings.Split(message, "\n") {
if re.MatchString(msg) {
msgs = append(msgs, re.ReplaceAllString(msg, "${Path}"))
}
}
return msgs, nil
}
// Search returns all the directories matching the search pattern
func (c *ServerConn) Searches(patterns []string) ([]string, error) {
msgs := make([]string, 0)
for _, pattern := range patterns {
msg, err := c.Search(pattern)
if err != nil {
return msgs, err
}
msgs = append(msgs, msg...)
}
return msgs, nil
}
// NoOp issues a NOOP FTP command.
// NOOP has no effects and is usually used to prevent the remote FTP server to
// close the otherwise idle connection.

6
go.mod
View File

@ -1,10 +1,10 @@
module git.siteop.biz/brouzouf/ftp
module github.com/jlaffaye/ftp
go 1.23.2
go 1.17
require (
github.com/hashicorp/go-multierror v1.1.1
github.com/stretchr/testify v1.10.0
github.com/stretchr/testify v1.9.0
)
require (

13
go.sum
View File

@ -1,3 +1,4 @@
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/hashicorp/errwrap v1.0.0 h1:hLrqtEDnRye3+sgx6z4qVLNuviH3MR5aQ0ykNJa/UYA=
@ -6,9 +7,17 @@ github.com/hashicorp/go-multierror v1.1.1 h1:H5DkEtf6CXdFp0N0Em5UCwQpXMWke8IA0+l
github.com/hashicorp/go-multierror v1.1.1/go.mod h1:iw975J/qwKPdAO1clOe2L8331t/9/fmwbPZ6JB6eMoM=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA=
github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw=
github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo=
github.com/stretchr/objx v0.5.2/go.mod h1:FRsXN1f5AsAjCGJKqEizvkpNtU+EGNCLh3NxZ/8L+MA=
github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=
github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg=
github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=