Skip to content

Go library that favors defaults over errors when parsing input.

Notifications You must be signed in to change notification settings

SoftKiwiGames/risky

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 

Repository files navigation

risky go library

Risky parses strings into corresponding types but ignores errors and default or zero values are returned instead.

Bit unsafe but gives values when you need them or you can trust the input.

Usage

type Animal struct {
    Name string
}

risky.JSON[Animal](`{"name":"kiwi"}`) // returns an instance of struct{Name: "kiwi"}
risky.JSON[Animal](`abc`) // returns zero value of struct{Name: ""}
risky.ParseInt("123") // returns 123
risky.ParseInt("invalid") // returns 0

About

Go library that favors defaults over errors when parsing input.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages