mirror of
https://github.com/gluster/glusterd2.git
synced 2026-02-05 21:45:43 +01:00
15 lines
305 B
Go
15 lines
305 B
Go
|
|
package api
|
||
|
|
|
||
|
|
import "strings"
|
||
|
|
|
||
|
|
// mapSize calculates and returns the size of the map passed as parameter in bytes
|
||
|
|
func mapSize(metadata map[string]string) int {
|
||
|
|
size := 0
|
||
|
|
for key, value := range metadata {
|
||
|
|
if !strings.HasPrefix(key, "_") {
|
||
|
|
size = size + len(key) + len(value)
|
||
|
|
}
|
||
|
|
}
|
||
|
|
return size
|
||
|
|
}
|