Skip to content

Commit

Permalink
code(pkg/connectors/from_file) - add support to path placeholders
Browse files Browse the repository at this point in the history
  • Loading branch information
PxyUp committed Jan 25, 2024
1 parent c19b79d commit ca3c0a7
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,7 @@ type FileConnectorConfig struct {
}
```

- Path - file path
- Path - file path. Support [formatting](#placeholder-list)
- UseFormatting[false] - use [formatting](#placeholder-list) file content or not

### StaticConnectorConfig
Expand Down
2 changes: 1 addition & 1 deletion pkg/connectors/from_file.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ type fileConnector struct {
}

func (j *fileConnector) Get(parsedValue builder.Jsonable, index *uint32) ([]byte, error) {
file, err := os.Open(j.cfg.Path)
file, err := os.Open(utils.Format(j.cfg.Path, parsedValue, index))
if err != nil {
j.logger.Errorw("cant open file", "error", err.Error())
return nil, err
Expand Down

0 comments on commit ca3c0a7

Please sign in to comment.