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:
commit
01384d434f
2 changed files with 5 additions and 5 deletions
|
@ -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}
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue