1
0
Fork 0
mirror of https://github.com/kubernetes-sigs/node-feature-discovery.git synced 2025-03-28 02:37:11 +00:00

Merge pull request #435 from marquiz/fixes/filepath

Replace improper usage of filepath.Join with path.Join
This commit is contained in:
Kubernetes Prow Robot 2021-02-10 03:44:59 -08:00 committed by GitHub
commit 01384d434f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 5 deletions

View file

@ -17,7 +17,7 @@ limitations under the License.
package apihelper
import (
"path/filepath"
"path"
"strings"
)
@ -29,6 +29,6 @@ type JsonPatch struct {
}
// NewJsonPatch returns a new JsonPatch object
func NewJsonPatch(verb string, path string, key string, value string) JsonPatch {
return JsonPatch{verb, filepath.Join(path, strings.ReplaceAll(key, "/", "~1")), value}
func NewJsonPatch(verb string, jsonpath string, key string, value string) JsonPatch {
return JsonPatch{verb, path.Join(jsonpath, strings.ReplaceAll(key, "/", "~1")), value}
}

View file

@ -24,7 +24,7 @@ import (
"log"
"net"
"os"
"path/filepath"
"path"
"regexp"
"sort"
"strconv"
@ -500,7 +500,7 @@ func addNs(src string, nsToAdd string) string {
if strings.Contains(src, "/") {
return src
}
return filepath.Join(nsToAdd, src)
return path.Join(nsToAdd, src)
}
// splitNs splits a name into its namespace and name parts