Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 3 of 3 for convertFileURLPath (0.16 sec)

  1. src/cmd/go/internal/web/url_other.go

    // Use of this source code is governed by a BSD-style
    // license that can be found in the LICENSE file.
    
    //go:build !windows
    
    package web
    
    import (
    	"errors"
    	"path/filepath"
    )
    
    func convertFileURLPath(host, path string) (string, error) {
    	switch host {
    	case "", "localhost":
    	default:
    		return "", errors.New("file URL specifies non-local host")
    	}
    	return filepath.FromSlash(path), nil
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Oct 28 18:17:57 UTC 2021
    - 446 bytes
    - Viewed (0)
  2. src/cmd/go/internal/web/url.go

    		return path, nil
    	}
    
    	if u.Path == "" {
    		if u.Host != "" || u.Opaque == "" {
    			return "", errors.New("file URL missing path")
    		}
    		return checkAbs(filepath.FromSlash(u.Opaque))
    	}
    
    	path, err := convertFileURLPath(u.Host, u.Path)
    	if err != nil {
    		return path, err
    	}
    	return checkAbs(path)
    }
    
    func urlFromFilePath(path string) (*url.URL, error) {
    	if !filepath.IsAbs(path) {
    		return nil, errNotAbsolute
    	}
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Jun 10 13:43:51 UTC 2019
    - 2K bytes
    - Viewed (0)
  3. src/cmd/go/internal/web/url_windows.go

    // Use of this source code is governed by a BSD-style
    // license that can be found in the LICENSE file.
    
    package web
    
    import (
    	"errors"
    	"path/filepath"
    	"strings"
    )
    
    func convertFileURLPath(host, path string) (string, error) {
    	if len(path) == 0 || path[0] != '/' {
    		return "", errNotAbsolute
    	}
    
    	path = filepath.FromSlash(path)
    
    	// We interpret Windows file URLs per the description in
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Jun 10 13:43:51 UTC 2019
    - 1.5K bytes
    - Viewed (0)
Back to top