Black Lives Matter. Support the Equal Justice Initiative.

Source file src/cmd/go/internal/web/url_other.go

Documentation: cmd/go/internal/web

     1  // Copyright 2019 The Go Authors. All rights reserved.
     2  // Use of this source code is governed by a BSD-style
     3  // license that can be found in the LICENSE file.
     4  
     5  //go:build !windows
     6  // +build !windows
     7  
     8  package web
     9  
    10  import (
    11  	"errors"
    12  	"path/filepath"
    13  )
    14  
    15  func convertFileURLPath(host, path string) (string, error) {
    16  	switch host {
    17  	case "", "localhost":
    18  	default:
    19  		return "", errors.New("file URL specifies non-local host")
    20  	}
    21  	return filepath.FromSlash(path), nil
    22  }
    23  

View as plain text