Giter VIP home page Giter VIP logo

go-safe's Introduction

Go Safe

Unsafe Risk

Go Reference

Description

Use nil safety value

Install

go get github.com/unsafe-risk/go-safe

Usage

import (
  // ...
  safe "github.com/unsafe-risk/go-safe"
)

https://pkg.go.dev/github.com/unsafe-risk/go-safe

  • TimeOrNow(t *time.Time) time.Time
  • StrOrZero(s *string) string
  • IOrZero(n *int) int
  • I8OrZero(n *int8) int8
  • I16OrZero(n *int16) int16
  • I32OrZero(n *int32) int32
  • I64OrZero(n *int64) int64
  • UiOrZero(n *uint) uint
  • Ui8OrZero(n *uint8) uint8
  • Ui16OrZero(n *uint16) uint16
  • Ui32OrZero(n *uint32) uint32
  • Ui64OrZero(n *uint64) uint64
  • F32OrZero(n *float32) float32
  • F64OrZero(n *float64) float64

  • TimeOrDefault(t *time.Time, def func() time.Time) time.Time
  • StrOrDefault(s *string, def func() string) string
  • IOrDefault(n *int, def func() int) int
  • I8OrDefault(n *int8, def func() int8) int8
  • I16OrDefault(n *int16, def func() int16) int16
  • I32OrDefault(n *int32, def func() int32) int32
  • I64OrDefault(n *int64, def func() int64) int64
  • UiOrDefault(n *uint, def func() uint) uint
  • Ui8OrDefault(n *uint8, def func() uint8) uint8
  • Ui16OrDefault(n *uint16, def func() uint16) uint16
  • Ui32OrDefault(n *uint32, def func() uint32) uint32
  • Ui64OrDefault(n *uint64, def func() uint64) uint64
  • F32OrDefault(n *float32, def func() float32) float32
  • F64OrDefault(n *float64, def func() float64) float64

  • StrZero() string
  • IZero() int
  • I8Zero() int8
  • I16Zero() int16
  • I32Zero() int32
  • I64Zero() int64
  • UiZero() uint
  • Ui8Zero() uint8
  • Ui16Zero() uint16
  • Ui32Zero() uint32
  • Ui64Zero() uint64
  • F32Zero() float32
  • F64Zero() float64

go-safe's People

Contributors

2rebi avatar juunini avatar lemon-mint avatar renovate[bot] avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

juunini

go-safe's Issues

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Open

These updates have all been created already. Click a checkbox below to force a retry/rebase of any.

Detected dependencies

github-actions
.github/workflows/go.yml
  • actions/setup-go v3
  • actions/checkout v3
gomod
go.mod
  • go 1.18

  • Check this box to trigger a request for Renovate to run again on this repository

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.