fix: trim prefix slash
This commit is contained in:
@@ -4,7 +4,6 @@ import (
|
||||
"crypto/rand"
|
||||
"fmt"
|
||||
"io"
|
||||
"io/ioutil"
|
||||
"net/http"
|
||||
"net/http/httptest"
|
||||
"net/url"
|
||||
@@ -91,8 +90,8 @@ func TestServer(t *testing.T) {
|
||||
args: args{
|
||||
store: func(t *testing.T) StoreFunc {
|
||||
return func(path string, content io.Reader) error {
|
||||
assert.Equal(t, "/some/file", path)
|
||||
temp, err := ioutil.ReadAll(content)
|
||||
assert.Equal(t, "some/file", path)
|
||||
temp, err := io.ReadAll(content)
|
||||
assert.NoError(t, err)
|
||||
assert.Equal(t, "abc", string(temp))
|
||||
return fmt.Errorf("error")
|
||||
@@ -175,8 +174,8 @@ func TestServer(t *testing.T) {
|
||||
args: args{
|
||||
store: func(t *testing.T) StoreFunc {
|
||||
return func(path string, content io.Reader) error {
|
||||
assert.Equal(t, "/20211125/588b41ebf261820104615b83201c729bd16016d6e43649b28b0ef77d54ca5aaf8da0ce74ae3f20a4", path)
|
||||
temp, err := ioutil.ReadAll(content)
|
||||
assert.Equal(t, "20211125/588b41ebf261820104615b83201c729bd16016d6e43649b28b0ef77d54ca5aaf8da0ce74ae3f20a4", path)
|
||||
temp, err := io.ReadAll(content)
|
||||
assert.NoError(t, err)
|
||||
assert.Equal(t, "abc", string(temp))
|
||||
return fmt.Errorf("error")
|
||||
|
||||
Reference in New Issue
Block a user