Created
January 26, 2019 10:05
-
-
Save heppu/ab7474e8094e363e43ea98dcd98ad5a0 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
type Storage interface { | |
Add(key, val string) error | |
} | |
func (s *SafeStorage) Add(key, val string) error { | |
s.storageMu.Lock() | |
defer s.storageMu.Unlock() | |
return s.storage.Add(key, val) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment