From 85af1ad3ba51d159086866541da7166eba3340dc Mon Sep 17 00:00:00 2001 From: Sarah Jamie Lewis Date: Tue, 18 Jan 2022 12:53:55 -0800 Subject: [PATCH] path -> filepath --- go.mod | 2 +- go.sum | 4 ++-- lib.go | 13 ++++++------- utils/settings.go | 2 +- 4 files changed, 10 insertions(+), 11 deletions(-) diff --git a/go.mod b/go.mod index 0c882ad..62c3a52 100644 --- a/go.mod +++ b/go.mod @@ -5,7 +5,7 @@ go 1.15 require ( cwtch.im/cwtch v0.14.12 git.openprivacy.ca/cwtch.im/server v1.4.2 - git.openprivacy.ca/openprivacy/connectivity v1.8.0 + git.openprivacy.ca/openprivacy/connectivity v1.8.1 git.openprivacy.ca/openprivacy/log v1.0.3 github.com/mutecomm/go-sqlcipher/v4 v4.4.2 golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f // indirect diff --git a/go.sum b/go.sum index 93a99a2..4ebcbb3 100644 --- a/go.sum +++ b/go.sum @@ -26,8 +26,8 @@ git.openprivacy.ca/openprivacy/bine v0.0.4/go.mod h1:13ZqhKyqakDsN/ZkQkIGNULsmLy git.openprivacy.ca/openprivacy/connectivity v1.5.0/go.mod h1:UjQiGBnWbotmBzIw59B8H6efwDadjkKzm3RPT1UaIRw= git.openprivacy.ca/openprivacy/connectivity v1.6.0/go.mod h1:UjQiGBnWbotmBzIw59B8H6efwDadjkKzm3RPT1UaIRw= git.openprivacy.ca/openprivacy/connectivity v1.7.0/go.mod h1:UjQiGBnWbotmBzIw59B8H6efwDadjkKzm3RPT1UaIRw= -git.openprivacy.ca/openprivacy/connectivity v1.8.0 h1:/jnc/2LuUpli2NgeLw6zOAVESHrz5mr10kDCQHyZ7R4= -git.openprivacy.ca/openprivacy/connectivity v1.8.0/go.mod h1:UjQiGBnWbotmBzIw59B8H6efwDadjkKzm3RPT1UaIRw= +git.openprivacy.ca/openprivacy/connectivity v1.8.1 h1:OjWy+JTAvlrstY8PnGPBp7Ho04JaKHaQ+YdoLwSdaCo= +git.openprivacy.ca/openprivacy/connectivity v1.8.1/go.mod h1:UjQiGBnWbotmBzIw59B8H6efwDadjkKzm3RPT1UaIRw= git.openprivacy.ca/openprivacy/log v1.0.2/go.mod h1:gGYK8xHtndRLDymFtmjkG26GaMQNgyhioNS82m812Iw= git.openprivacy.ca/openprivacy/log v1.0.3 h1:E/PMm4LY+Q9s3aDpfySfEDq/vYQontlvNj/scrPaga0= git.openprivacy.ca/openprivacy/log v1.0.3/go.mod h1:gGYK8xHtndRLDymFtmjkG26GaMQNgyhioNS82m812Iw= diff --git a/lib.go b/lib.go index 535f8f1..26fb84a 100644 --- a/lib.go +++ b/lib.go @@ -11,7 +11,7 @@ import ( "encoding/json" "fmt" "io/ioutil" - "path" + path "path/filepath" "strconv" constants2 "cwtch.im/cwtch/model/constants" @@ -43,7 +43,6 @@ import ( "encoding/base64" mrand "math/rand" "os" - "path/filepath" "time" "git.openprivacy.ca/openprivacy/connectivity/tor" @@ -142,7 +141,7 @@ func _startCwtch(appDir string, torPath string) { if appDir == "~" { appDir = homeDir } else if strings.HasPrefix(appDir, "~/") { - appDir = filepath.Join(homeDir, appDir[2:]) + appDir = path.Join(homeDir, appDir[2:]) } // Ensure that the application directory exists...and then initialize settings.. @@ -161,7 +160,7 @@ func _startCwtch(appDir string, torPath string) { log.Infof("Loading Cwtch Directory %v and tor path: %v", appDir, torPath) log.Infof("making directory %v", appDir) - err = os.MkdirAll(filepath.Join(appDir, "tor"), 0700) + err = os.MkdirAll(path.Join(appDir, "tor"), 0700) if err != nil { log.Errorf("error creating tor data directory: %v. Aborting app start up", err) @@ -231,7 +230,7 @@ func buildACN(settings utils.GlobalSettings, torPath string, appDir string) conn } log.Infof("making directory %v", appDir) - err = os.MkdirAll(filepath.Join(appDir, "tor"), 0700) + err = os.MkdirAll(path.Join(appDir, "tor"), 0700) if err != nil { log.Errorf("error creating tor data directory: %v. Aborting app start up", err) @@ -256,7 +255,7 @@ func buildACN(settings utils.GlobalSettings, torPath string, appDir string) conn utils.WriteGlobalSettings(settings) } - err = torrc.Build(filepath.Join(appDir, "tor", "torrc")) + err = torrc.Build(path.Join(appDir, "tor", "torrc")) if err != nil { log.Errorf("error constructing torrc: %v", err) @@ -269,7 +268,7 @@ func buildACN(settings utils.GlobalSettings, torPath string, appDir string) conn // purge data dir directories if we are not using them for a cache torDir := path.Join(appDir, "tor") - files, err := filepath.Glob(path.Join(torDir, "data-dir-*")) + files, err := path.Glob(path.Join(torDir, "data-dir-*")) if err != nil { log.Errorf("could not construct filesystem glob: %v", err) } diff --git a/utils/settings.go b/utils/settings.go index 3a9cc6a..5acfee1 100644 --- a/utils/settings.go +++ b/utils/settings.go @@ -1,6 +1,7 @@ package utils import ( + path "path/filepath" "sync" "cwtch.im/cwtch/event" @@ -9,7 +10,6 @@ import ( "encoding/json" "io/ioutil" "os" - "path" "git.openprivacy.ca/openprivacy/log" )