diff --git a/.travis.yml b/.travis.yml index 1c8a520..b5bd607 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,7 +2,7 @@ sudo: required language: go go: - - 1.9 + - 1.12 services: - docker diff --git a/api/mojang/queue/queue_test.go b/api/mojang/queue/queue_test.go index f9e82ac..c94858b 100644 --- a/api/mojang/queue/queue_test.go +++ b/api/mojang/queue/queue_test.go @@ -261,11 +261,13 @@ func TestJobsQueueSuite(t *testing.T) { suite.Run(t, new(QueueTestSuite)) } +var replacer = strings.NewReplacer("-", "_", "=", "") + // https://stackoverflow.com/a/50581165 func randStr(len int) string { buff := make([]byte, len) _, _ = rand.Read(buff) - str := strings.ReplaceAll(base64.URLEncoding.EncodeToString(buff), "-", "_") + str := replacer.Replace(base64.URLEncoding.EncodeToString(buff)) // Base 64 can be longer than len return str[:len]