Skip to content

Commit dd5f3b5

Browse files
committed
refactor: refactor configuration file handling
- Remove the `trimPath` function - Change `trimPath(p.Config.Source)` to `trimValues(p.Config.Source)` Signed-off-by: Bo-Yi.Wu <[email protected]>
1 parent 95b0159 commit dd5f3b5

File tree

1 file changed

+1
-16
lines changed

1 file changed

+1
-16
lines changed

plugin.go

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -86,21 +86,6 @@ func (e copyError) Error() string {
8686
return fmt.Sprintf("error copy file to dest: %s, error message: %s\n", e.host, e.message)
8787
}
8888

89-
func trimPath(keys []string) []string {
90-
var newKeys []string
91-
92-
for _, value := range keys {
93-
value = strings.Trim(value, " ")
94-
if len(value) == 0 {
95-
continue
96-
}
97-
98-
newKeys = append(newKeys, value)
99-
}
100-
101-
return newKeys
102-
}
103-
10489
func globList(paths []string) fileList {
10590
var list fileList
10691

@@ -268,7 +253,7 @@ func (p *Plugin) Exec() error {
268253
return errMissingSourceOrTarget
269254
}
270255

271-
files := globList(trimPath(p.Config.Source))
256+
files := globList(trimValues(p.Config.Source))
272257
p.DestFile = fmt.Sprintf("%s.tar", random.String(10))
273258

274259
// create a temporary file for the archive

0 commit comments

Comments
 (0)