Categorygo.nhat.io/wait
repositorypackage
0.1.0
Repository: https://github.com/nhatthm/go-wait.git
Documentation: pkg.go.dev

# Packages

No description provided by the author

# README

Wait

GitHub Releases Build Status codecov Go Report Card GoDevDoc Donate

A simple library to wait for something.

Prerequisites

  • Go >= 1.17

Install

go get go.nhat.io/wait

Usage

package main

import (
	"context"
	"time"

	"go.nhat.io/wait"
)

func execute(ctx context.Context) error {
	if err := wait.ForDuration(time.Minute).Wait(ctx); err != nil {
        return err
	}

	// Do something here.

	return nil
}

Donation

If this project help you reduce time to develop, you can give me a cup of coffee :)

Paypal donation

paypal

       or scan this