feat: change report

This commit is contained in:
崔竞宁
2022-09-14 12:06:53 +08:00
parent 7e7d887b2e
commit a63d804054
3 changed files with 18 additions and 15 deletions

13
opt.go
View File

@@ -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]
}