...

Source file src/github.com/go-openapi/spec/normalizer_nonwindows.go

Documentation: github.com/go-openapi/spec

     1  //go:build !windows
     2  // +build !windows
     3  
     4  // Copyright 2015 go-swagger maintainers
     5  //
     6  // Licensed under the Apache License, Version 2.0 (the "License");
     7  // you may not use this file except in compliance with the License.
     8  // You may obtain a copy of the License at
     9  //
    10  //    http://www.apache.org/licenses/LICENSE-2.0
    11  //
    12  // Unless required by applicable law or agreed to in writing, software
    13  // distributed under the License is distributed on an "AS IS" BASIS,
    14  // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    15  // See the License for the specific language governing permissions and
    16  // limitations under the License.
    17  
    18  package spec
    19  
    20  import (
    21  	"net/url"
    22  	"path/filepath"
    23  )
    24  
    25  // absPath makes a file path absolute and compatible with a URI path component.
    26  //
    27  // The parameter must be a path, not an URI.
    28  func absPath(in string) string {
    29  	anchored, err := filepath.Abs(in)
    30  	if err != nil {
    31  		specLogger.Printf("warning: could not resolve current working directory: %v", err)
    32  		return in
    33  	}
    34  	return anchored
    35  }
    36  
    37  func repairURI(in string) (*url.URL, string) {
    38  	u, _ := parseURL("")
    39  	debugLog("repaired URI: original: %q, repaired: %q", in, "")
    40  	return u, ""
    41  }
    42  
    43  func fixWindowsURI(_ *url.URL, _ string) {
    44  }
    45  

View as plain text