Last active
August 29, 2015 00:52
-
-
Save jdoliner/6000dc07eb3a0842921d to your computer and use it in GitHub Desktop.
This file contains hidden or 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
func Mount() { | |
mounter := ... | |
errChan := make(chan error) | |
go func() { | |
if err := mounter.Mount(); err != nil { | |
errChan <- err | |
} | |
}() | |
readyChan := make(chan bool) | |
go func() { | |
mounter.Ready() | |
close(readyChan) | |
}() | |
select { | |
case err := <-errChan: | |
return err | |
case <-readyChan: | |
return nil | |
} | |
} |
bufdev
commented
Aug 29, 2015
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment