並行メソッドを取得するにはどうすればよいですか?
type test struct {
foo uint8
bar uint8
}
func NewTest(arg1 string) (*test, os.Error) {...}
func (self *test) Get(str string) ([]byte, os.Error) {...}
Get()メソッドのすべてのコードをの中に入れgo func()てから、チャネルを使用する 必要があると思います。
func (self *test) Get(str string) ([]byte, os.Error) {
go func() {
// Code for this method.
}()
}
- から別のメソッドを呼び出すと問題が発生し
Get()ますか?それとも同時である必要がありますか?