Replace path with filepath for cross-platform compatibility

- Updated imports and function calls to use `filepath` across all token storage implementations and server entry point.
- Ensured consistent handling of directory and file paths for improved portability.
This commit is contained in:
Luis Pater
2025-09-04 08:23:51 +08:00
parent ad943b2d4d
commit d4709ffcf9
5 changed files with 12 additions and 12 deletions

View File

@@ -7,7 +7,7 @@ import (
"encoding/json"
"fmt"
"os"
"path"
"path/filepath"
)
// CodexTokenStorage stores OAuth2 token information for OpenAI Codex API authentication.
@@ -43,7 +43,7 @@ type CodexTokenStorage struct {
// - error: An error if the operation fails, nil otherwise
func (ts *CodexTokenStorage) SaveTokenToFile(authFilePath string) error {
ts.Type = "codex"
if err := os.MkdirAll(path.Dir(authFilePath), 0700); err != nil {
if err := os.MkdirAll(filepath.Dir(authFilePath), 0700); err != nil {
return fmt.Errorf("failed to create directory: %v", err)
}