misc, docs: Move to golang 1.12

This commit is contained in:
James Shubin
2020-09-23 11:34:25 -04:00
parent 5bc985663c
commit d75f763c99
7 changed files with 15 additions and 15 deletions

View File

@@ -70,9 +70,9 @@ func ResPathUID(res engine.Res) string {
// a name of: /tmp/mgmt/foo is /tmp-mgmt-foo and
// a name of: /tmp/mgmt-foo -> /tmp-mgmt-foo if we replace slashes.
// As a result, we base64 encode (but without slashes).
name := strings.Replace(res.Name(), "/", "-", -1) // TODO: use ReplaceAll in 1.12
if os.PathSeparator != '/' { // lol windows?
name = strings.Replace(name, string(os.PathSeparator), "-", -1) // TODO: use ReplaceAll in 1.12
name := strings.ReplaceAll(res.Name(), "/", "-")
if os.PathSeparator != '/' { // lol windows?
name = strings.ReplaceAll(name, string(os.PathSeparator), "-")
}
b := []byte(res.Name())
encoded := base64.URLEncoding.EncodeToString(b)