Installation¶
Requirements¶
- Go 1.23 or later
Install¶
Install the package using go get:
Import¶
Import the package in your Go code:
Verify Installation¶
Create a simple test file to verify the installation:
package main
import (
"context"
"fmt"
"github.com/logimos/concurrent"
)
func main() {
ctx := context.Background()
data := []int{1, 2, 3}
results, err := concurrent.MapConcurrent(ctx, data, 2, func(ctx context.Context, n int) (int, error) {
return n * 2, nil
})
if err != nil {
panic(err)
}
fmt.Println(results) // [2 4 6]
}
Run it:
If you see [2 4 6] printed, the installation is successful!