
Security News
npm Adopts OIDC for Trusted Publishing in CI/CD Workflows
npm now supports Trusted Publishing with OIDC, enabling secure package publishing directly from CI/CD workflows without relying on long-lived tokens.
github.com/cheekybits/is
A mini testing helper for Go.
is.OK
and is.Equal
)testing.T
)is.Panic
and is.PanicWith
helpers - because testing panics is uglyis := is.New(t)
at top of your test functionsis
objectfunc TestSomething(t *testing.T) {
is := is.New(t)
// ensure not nil
obj := SomeFunc()
is.OK(obj)
// ensure no error
obj, err := SomeFunc()
is.NoErr(err)
// ensure not false
b := SomeBool()
is.OK(b)
// ensure not ""
s := SomeString()
is.OK(s)
// ensure not zero
is.OK(len(something))
// ensure doesn't panic
is.OK(func(){
MethodShouldNotPanic()
})
// ensure many things in one go
is.OK(b, err, obj, "something")
// ensure something does panic
is.Panic(func(){
MethodShouldPanic(1)
})
is.PanicWith("package: arg must be >0", func(){
MethodShouldPanicWithSpecificMessage(0)
})
// make sure two values are equal
is.Equal(1, 2)
is.Equal(err, ErrSomething)
is.Equal(a, b)
}
Get it:
go get github.com/cheekybits/is
Then import it:
import (
"testing"
"github.com/cheekybits/is"
)
FAQs
Unknown package
Did you know?
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.
Security News
npm now supports Trusted Publishing with OIDC, enabling secure package publishing directly from CI/CD workflows without relying on long-lived tokens.
Research
/Security News
A RubyGems malware campaign used 60 malicious packages posing as automation tools to steal credentials from social media and marketing tool users.
Security News
The CNA Scorecard ranks CVE issuers by data completeness, revealing major gaps in patch info and software identifiers across thousands of vulnerabilities.