mirror of
https://github.com/samuelncui/acp.git
synced 2026-01-07 11:45:15 +00:00
feat: change report
This commit is contained in:
13
opt.go
13
opt.go
@@ -89,12 +89,7 @@ type Option func(*option) *option
|
||||
func Source(paths ...string) Option {
|
||||
return func(o *option) *option {
|
||||
for _, p := range paths {
|
||||
p = strings.TrimSpace(p)
|
||||
if p == "" {
|
||||
continue
|
||||
}
|
||||
p = path.Clean(p)
|
||||
|
||||
if p[len(p)-1] == '/' {
|
||||
p = p[:len(p)-1]
|
||||
}
|
||||
@@ -108,12 +103,10 @@ func Source(paths ...string) Option {
|
||||
|
||||
func AccurateSource(base string, relativePaths ...string) Option {
|
||||
return func(o *option) *option {
|
||||
for _, p := range relativePaths {
|
||||
p = strings.TrimSpace(p)
|
||||
if p == "" {
|
||||
continue
|
||||
}
|
||||
base = path.Clean(base)
|
||||
|
||||
for _, p := range relativePaths {
|
||||
p = path.Clean(p)
|
||||
if p[len(p)-1] == '/' {
|
||||
p = p[:len(p)-1]
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user