Skip to content

Commit

Permalink
fix: add fixture ids
Browse files Browse the repository at this point in the history
  • Loading branch information
laurentsenta committed May 11, 2023
1 parent 90aec1d commit d3e25ce
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions cmd/gateway-conformance/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,22 @@ func copyFiles(inputPaths []string, outputDirectoryPath string) error {
if err != nil {
return err
}
for _, inputPath := range inputPaths {
outputPath := filepath.Join(outputDirectoryPath, filepath.Base(inputPath))
for i, inputPath := range inputPaths {
src, err := os.Open(inputPath)
if err != nil {
return err
}
defer src.Close()

// Separate the base name and extension
base := filepath.Base(inputPath)
ext := filepath.Ext(inputPath)
name := base[0:len(base)-len(ext)]

// Generate the new filename
newName := fmt.Sprintf("%s_%d%s", name, i, ext)

outputPath := filepath.Join(outputDirectoryPath, newName)
dst, err := os.Create(outputPath)
if err != nil {
return err
Expand Down

0 comments on commit d3e25ce

Please sign in to comment.