mirror of
https://github.com/googleapis/genai-toolbox.git
synced 2026-01-10 07:58:12 -05:00
fix: update path library (#678)
Using filepath.Join for embed filenames will not respect Windows filepaths. https://github.com/golang/go/issues/44305 Fix #662
This commit is contained in:
@@ -17,7 +17,7 @@ package prebuiltconfigs
|
||||
import (
|
||||
"embed"
|
||||
"fmt"
|
||||
"path/filepath"
|
||||
"path"
|
||||
"strings"
|
||||
)
|
||||
|
||||
@@ -66,7 +66,7 @@ func loadPrebuiltToolYAMLs() (map[string][]byte, []string, error) {
|
||||
for _, entry := range entries {
|
||||
lowerName := strings.ToLower(entry.Name())
|
||||
if !entry.IsDir() && (strings.HasSuffix(lowerName, ".yaml")) {
|
||||
filePathInFS := filepath.Join("tools", entry.Name())
|
||||
filePathInFS := path.Join("tools", entry.Name())
|
||||
content, err := prebuiltConfigsFS.ReadFile(filePathInFS)
|
||||
if err != nil {
|
||||
errMsg := fmt.Errorf("failed to read a prebuilt tool %w", err)
|
||||
|
||||
Reference in New Issue
Block a user