Big News: Socket raises $60M Series C at a $1B valuation to secure software supply chains for AI-driven development.Announcement
Sign In

go-simpler.org/check

Package Overview
Dependencies
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

go-simpler.org/check

Go Modules
Version
v0.4.0
Version published
Created
Source

check

checks pkg.go.dev goreportcard codecov

Convenience helpers to perform validations of any kind

📦 Install

go get go-simpler.org/check

📋 Usage

Use That/Thatf to write conditions to check, multiple calls can be chained. The last call in the chain must be FirstError, AllErrors, or JoinErrors.

err := check.
    That(user.Name != "", errEmptyName).
    Thatf(user.Age >= 18, "%d y.o. is too young", user.Age).
    Thatf(isEmail(user.Email), "%s is invalid email", user.Email).
    JoinErrors() // or FirstError() / AllErrors().

FAQs

Package last updated on 11 Oct 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts