unsafe

package
v0.12.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 10, 2022 License: MIT Imports: 0 Imported by: 12

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DoSilent

func DoSilent(interface{}, error)

DoSilent accepts a result of * fmt.Fprint* function family * io.Copy* and io.Read* function family * io.Writer interface and allows to ignore it.

unsafe.DoSilent(fmt.Fprintln(writer, "ignore the result"))

func Ignore

func Ignore(error)

Ignore accepts an error and allows to ignore it.

unsafe.Ignore(
	template.Must(template.New("html").Parse(content)).Execute(writer, data),
)

func Return added in v0.11.1

func Return(in interface{}, _ error) interface{}

Return accepts a result with an error and returns the first to cast it later.

import (
	"github.com/Masterminds/semver"
	"go.octolab.org/unsafe"
)

var min := unsafe.Return(semver.NewConstraint(">= 92.0")).(*semver.Constraints)

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL