https://github.com/euskadi31/go-future
go-future is an implementation of future in Go.
https://github.com/euskadi31/go-future
async future futures go go-module go-modules golang
Last synced: about 1 month ago
JSON representation
go-future is an implementation of future in Go.
- Host: GitHub
- URL: https://github.com/euskadi31/go-future
- Owner: euskadi31
- License: mit
- Created: 2019-10-28T16:50:36.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2025-11-25T06:27:58.000Z (7 months ago)
- Last Synced: 2025-12-30T21:50:58.046Z (6 months ago)
- Topics: async, future, futures, go, go-module, go-modules, golang
- Language: Go
- Homepage:
- Size: 43.9 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# Go Future [](https://github.com/euskadi31/go-future/releases/latest) [](https://godoc.org/github.com/euskadi31/go-future)
[](https://goreportcard.com/report/github.com/euskadi31/go-future)
| Branch | Status | Coverage |
| ------ | --------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------- |
| master | [](https://github.com/euskadi31/go-future/actions/workflows/go.yml) | [](https://coveralls.io/github/euskadi31/go-future?branch=master) |
go-future is an implementation of future in Go.
## Example
```go
package main
import (
"fmt"
"github.com/euskadi31/go-future"
)
func asyncFunc() *future.Future {
f := future.New()
go func(f *future.Future) {
f.Value("my async value")
}(f)
return f
}
func main() {
f := asyncFunc();
v, err := f.Get()
if err != nil {
panic(err)
}
fmt.Println(v)
}
```
With `Fill`
```go
package main
import (
"fmt"
"github.com/euskadi31/go-future"
)
func asyncFunc() *future.Future {
f := future.New()
go func(f *future.Future) {
f.Value("my async value")
}(f)
return f
}
func main() {
f := asyncFunc();
var v string
if err := f.Fill(&v); err != nil {
panic(err)
}
fmt.Println(v)
}
```
## License
go-future is licensed under [the MIT license](LICENSE.md).