ptrfrom

package
v0.8.3 Latest Latest
Warning

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

Go to latest
Published: Sep 10, 2024 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Overview

Package ptrfrom helps getting pointers when declaring literals in tests.

Example:

wantArtifactSpec := model.ArtifactSpec {
  Algorithm: ptrfrom.String("sha256"),
  Digest:    ptrfrom.String("asdfqwer"),
}

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Any added in v0.2.0

func Any[T any](v T) *T

Any helps get pointers from any type for test literals

func Bool

func Bool(v bool) *bool

Bool helps get bool pointers for test literals

func Float64

func Float64(v float64) *float64

Float64 helps get float64 pofloaters for test literals

func Int

func Int(v int) *int

Int helps get int pointers for test literals

func Int64

func Int64(v int64) *int64

Int64 helps get int64 pointers for test literals

func String

func String(v string) *string

String helps get string pointers for test literals

func Time added in v0.1.1

func Time(v time.Time) *time.Time

Time helps get time pointers for test literals

Types

This section is empty.

Jump to

Keyboard shortcuts

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