refactor: use path/filepath instead of path for joining path parts

This commit is contained in:
Jose Diaz-Gonzalez
2020-10-10 17:24:31 -04:00
committed by Jose Diaz-Gonzalez
parent ff7429fd00
commit 943e032d12
2 changed files with 6 additions and 6 deletions

View File

@@ -4,7 +4,7 @@ import (
"bufio" "bufio"
"fmt" "fmt"
"os" "os"
"path" "path/filepath"
"github.com/dokku/dokku/plugins/common" "github.com/dokku/dokku/plugins/common"
) )
@@ -58,7 +58,7 @@ func TriggerPostExtract(appName string, sourceWorkDir string) {
return return
} }
buildpacksPath := path.Join(sourceWorkDir, ".buildpacks") buildpacksPath := filepath.Join(sourceWorkDir, ".buildpacks")
file, err := os.OpenFile(buildpacksPath, os.O_RDWR|os.O_TRUNC|os.O_CREATE, 0600) file, err := os.OpenFile(buildpacksPath, os.O_RDWR|os.O_TRUNC|os.O_CREATE, 0600)
if err != nil { if err != nil {
common.LogFail(fmt.Sprintf("Error writing .buildpacks file: %s", err.Error())) common.LogFail(fmt.Sprintf("Error writing .buildpacks file: %s", err.Error()))

View File

@@ -7,7 +7,7 @@ import (
"io/ioutil" "io/ioutil"
"os" "os"
"os/user" "os/user"
"path" "path/filepath"
"reflect" "reflect"
"strconv" "strconv"
"strings" "strings"
@@ -447,17 +447,17 @@ func PropertySetup(pluginName string) error {
func getPropertyPath(pluginName string, appName string, property string) string { func getPropertyPath(pluginName string, appName string, property string) string {
pluginAppConfigRoot := getPluginAppPropertyPath(pluginName, appName) pluginAppConfigRoot := getPluginAppPropertyPath(pluginName, appName)
return path.Join(pluginAppConfigRoot, property) return filepath.Join(pluginAppConfigRoot, property)
} }
// getPluginAppPropertyPath returns the plugin property path for a given plugin/app combination // getPluginAppPropertyPath returns the plugin property path for a given plugin/app combination
func getPluginAppPropertyPath(pluginName string, appName string) string { func getPluginAppPropertyPath(pluginName string, appName string) string {
return path.Join(getPluginConfigPath(pluginName), appName) return filepath.Join(getPluginConfigPath(pluginName), appName)
} }
// getPluginConfigPath returns the plugin property path for a given plugin // getPluginConfigPath returns the plugin property path for a given plugin
func getPluginConfigPath(pluginName string) string { func getPluginConfigPath(pluginName string) string {
return path.Join(MustGetEnv("DOKKU_LIB_ROOT"), "config", pluginName) return filepath.Join(MustGetEnv("DOKKU_LIB_ROOT"), "config", pluginName)
} }
// makePluginAppPropertyPath ensures that a property path exists // makePluginAppPropertyPath ensures that a property path exists