podman
44 строки · 1.2 Кб
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
18package spec
19
20import (
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.
28func absPath(in string) string {
29anchored, err := filepath.Abs(in)
30if err != nil {
31specLogger.Printf("warning: could not resolve current working directory: %v", err)
32return in
33}
34return anchored
35}
36
37func repairURI(in string) (*url.URL, string) {
38u, _ := parseURL("")
39debugLog("repaired URI: original: %q, repaired: %q", in, "")
40return u, ""
41}
42
43func fixWindowsURI(u *url.URL, in string) {
44}
45