Skip to content

Commit

Permalink
Return nil when blob tags map is empty (#293)
Browse files Browse the repository at this point in the history
* Check if blobTagsMap map is empty or nil

* headers

* incl all functions
  • Loading branch information
jared-gs authored Aug 25, 2021
1 parent adf3651 commit 3780d5b
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions azblob/url_blob.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@ package azblob

import (
"context"
"github.com/Azure/azure-pipeline-go/pipeline"
"net/url"
"strings"

"github.com/Azure/azure-pipeline-go/pipeline"
)

// A BlobURL represents a URL to an Azure Storage blob; the blob may be a block blob, append blob, or page blob.
Expand Down Expand Up @@ -75,7 +76,7 @@ func (b BlobURL) ToPageBlobURL() PageBlobURL {
}

func SerializeBlobTagsHeader(blobTagsMap BlobTagsMap) *string {
if blobTagsMap == nil {
if len(blobTagsMap) == 0 {
return nil
}
tags := make([]string, 0)
Expand All @@ -88,7 +89,7 @@ func SerializeBlobTagsHeader(blobTagsMap BlobTagsMap) *string {
}

func SerializeBlobTags(blobTagsMap BlobTagsMap) BlobTags {
if blobTagsMap == nil {
if len(blobTagsMap) == 0 {
return BlobTags{}
}
blobTagSet := make([]BlobTag, 0, len(blobTagsMap))
Expand Down

0 comments on commit 3780d5b

Please sign in to comment.