Created
September 3, 2022 18:51
-
-
Save madflojo/6700bdf205ae0d345d3d6db23967fc86 to your computer and use it in GitHub Desktop.
ThreadSafe Packages - SetName
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
// SetName will change the name of the current Directory. | |
func (d *Directory) SetName(n string) error { | |
if n == "" { | |
return fmt.Errorf("cannot have an empty name") | |
} | |
d.Lock() | |
defer d.Unlock() | |
d.name = n | |
return nil | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment