refactor and fix strings.Split

This commit is contained in:
chrislu
2022-08-07 01:34:32 -07:00
parent 1a4bf0dcb5
commit 67814a5c79
8 changed files with 11 additions and 19 deletions

View File

@@ -3,6 +3,7 @@ package s3api
import (
"encoding/xml"
"fmt"
"github.com/seaweedfs/seaweedfs/weed/util"
"regexp"
"strings"
)
@@ -43,7 +44,7 @@ func FromTags(tags map[string]string) (t *Tagging) {
func parseTagsHeader(tags string) (map[string]string, error) {
parsedTags := make(map[string]string)
for _, v := range strings.Split(tags, "&") {
for _, v := range util.StringSplit(tags, "&") {
tag := strings.Split(v, "=")
if len(tag) == 2 {
parsedTags[tag[0]] = tag[1]