removed golang x package in favour of the std lib

This commit is contained in:
Emilien Puget
2024-06-15 09:55:44 +02:00
committed by quobix
parent f27d57aab0
commit cbe1201cbd
13 changed files with 22 additions and 31 deletions

View File

@@ -18,8 +18,8 @@ import (
"github.com/pb33f/libopenapi/datamodel"
"github.com/pb33f/libopenapi/utils"
"golang.org/x/sync/syncmap"
"gopkg.in/yaml.v3"
"sync"
)
const (
@@ -38,8 +38,8 @@ type RemoteFS struct {
rootURL string
rootURLParsed *url.URL
RemoteHandlerFunc utils.RemoteURLHandler
Files syncmap.Map
ProcessingFiles syncmap.Map
Files sync.Map
ProcessingFiles sync.Map
FetchTime int64
FetchChannel chan *RemoteFile
remoteErrors []error
@@ -344,10 +344,10 @@ func (i *RemoteFS) Open(remoteURL string) (fs.File, error) {
remoteParsedURL.Host = i.rootURLParsed.Host
remoteParsedURL.Scheme = i.rootURLParsed.Scheme
// this has been disabled, because I don't think it has value, it causes more problems than it solves currently.
//if !strings.HasPrefix(remoteParsedURL.Path, "/") {
// if !strings.HasPrefix(remoteParsedURL.Path, "/") {
// remoteParsedURL.Path = filepath.Join(i.rootURLParsed.Path, remoteParsedURL.Path)
// remoteParsedURL.Path = strings.ReplaceAll(remoteParsedURL.Path, "\\", "/")
//}
// }
}
if remoteParsedURL.Scheme == "" {