fix linting

Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
This commit is contained in:
2020-11-03 01:04:56 +03:00
parent e6ab6d50eb
commit 5346e8630b
36 changed files with 218 additions and 188 deletions

View File

@@ -14,9 +14,11 @@ type metadataKey struct{}
type Metadata map[string]string
var (
// DefaultMetadataSize used when need to init new Metadata
DefaultMetadataSize = 6
)
// Get returns value from metadata by key
func (md Metadata) Get(key string) (string, bool) {
// fast path
val, ok := md[key]
@@ -27,10 +29,12 @@ func (md Metadata) Get(key string) (string, bool) {
return val, ok
}
// Set is used to store value in metadata
func (md Metadata) Set(key, val string) {
md[textproto.CanonicalMIMEHeaderKey(key)] = val
}
// Del is used to remove value from metadata
func (md Metadata) Del(key string) {
// fast path
if _, ok := md[key]; ok {